Top "Binary-search-tree" questions

A binary search tree is a data structure which consists of a root node with left and right child nodes.

Built-in binary search tree in Python?

Are there any self-balancing binary search tree (RED-BLACK, AVL or others) built-in types in Python 2.7 or Python 3.x? I am …

python binary-search-tree built-in
For a complete binary tree with n nodes, how many nodes are leaf nodes?

One of the answers in our powerpoint says it is n/2 leaves, but I am seeing another answer which says (…

tree nodes binary-search-tree
Number of binary search trees over n distinct elements

How many binary search trees can be constructed from n distinct elements? And how can we find a mathematically proved …

algorithm math binary-tree binary-search-tree proof
How to Find the Branching Factor of a Tree

A particular search tree has 6 nodes at level 3. At the next level, there are 24 nodes. What is the branching factor …

algorithm binary-search-tree search-tree
How to construct BST given post-order traversal

I know there are ways to construct a tree from pre-order traversal (as an array). The more common question is …

algorithm recursion binary-tree binary-search-tree
Why implement a Hashtable with a Binary Search Tree?

When implementing a Hashtable using an array, we inherit the constant time indexing of the array. What are the reasons …

data-structures hashtable binary-search-tree
Second max in BST

This is an interview question. Find the second max in BST. The max element is the rightmost leaf in the …

algorithm data-structures language-agnostic binary-search-tree
How do you know where to perform rotations in an AVL tree?

So I'm self teaching AVL trees and I understand the basic idea behind it, but I just want to make …

algorithm data-structures rotation binary-search-tree avl-tree
Inserting an equal value element

I am currently studying binary search trees, and I was wondering what do you do if you try to insert …

algorithm binary-search-tree
Difference between binary search and binary search tree?

What is the difference between binary search and binary search tree? Are they the same? Reading the internet it seems …

algorithm data-structures binary-search-tree binary-search