I am trying to find a name within a key. I think it is retrieving it fine. however, its coming up as not found. maybe my code is wrong somewhere?
I would like to calculate the summation of the depths of each node of a Binary 开发者_如何学JAVASearch Tree.
I am having difficulty calculat开发者_运维问答ing the summation of depths [the sum of the individual depths for all children of the root] for a given BST. I have the total number of nodes for the tree
I\'m trying to make a BST and need to print it inorder, postorder, and preorder. The thing am not sure about is how to create this tree in my main() function.
Im a little confused. Im wondering if an array based Binary Search tree is implemented this way? void BST::insert(item &items, const data & aData )
I\'ve tried to do it recursively..The parent integer varaible would is like i, conforming to the formula, 2*i +1 for leftChild\'s and 2*i +2 for the right.
Im trying to build an array based, "Binary Search Tree" by following the algorithm here. Using the algorithm I came up with the following code:
I hav开发者_Python百科e a question about how would I remove a child from a node (root)?Since I can\'t call remove, if I make the child null, will the children of that child move up? Like, would I just
My bst has to be able to cope with duplicate entries. Does anyone have any strategies for how to go about this that doesn\'t require excessive amounts of code?
even though I have appended item into my array while recursively going through the tree, my code returns an empty array every time I try to run it.