Answer to Question #52584 in C++ for Masego
Write a definition of the function insertBTree to recursively inserts record into a b-tree
1
2015-06-04T03:40:54-0400
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!
Learn more about our help with Assignments:
C++
Comments
Leave a comment