64 747
Assignments Done
99,3%
Successfully Done
In September 2018

Answer to Question #52584 in C++ for Masego

Question #52584
Write a definition of the function insertBTree to recursively inserts record into a b-tree
Expert's answer
template <typename T>
void BTTree<T> :: insertBTree(node<T>**tree,T item){
if(*tree == NULL){
*tree = new node<T>;
(*tree)->data = item;
(*tree)->left = NULL;
(*tree)->right = NULL;
}
else{
if( (*tree)->data > item)
insertBTree(&((*tree)->left),item);
else
insertBTree(&((*tree)->right),item);
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions