Week 3
void BST::InsertItem ( ptrType &TreePtr, int NewItem, bool &success);
Test it using the test function (defined in main) in the file BST.cpp. [Hint: understanding how to do this may help you with Assignment 1.)
int binarySearch {char A[], first, last, char key}
{ if (first+1 >= last) return first;
else{
int mid= (first+last)/2;
if (A[mid] <= key) return binarySearch(A, mid, last, key);
else return binarySearch(A, first, mid, key);
}
}
All enquiries to Annabelle McIver