
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The instructions and guidelines for quiz #4 of the cs2143-2144 data structures course, spring 2012. Students are required to implement the insert and search functions for a bstree (binary search tree) class. The quiz consists of 10 multiple-choice questions and has a time limit of 10 minutes.
Typology: Exercises
1 / 1
This page cannot be seen from the preview
Don't miss anything!

class bstree { protected: int *p; // array of values int *f; // array of flag unsigned int size;
public: bstree(unsigned int s) { int i; p = new int [s]; f = new int [s]; size = s; for (i=0; i<s; ++i) f[i] = 0; }
int insert(int v); //insert value v in the BST, and return 1 if it is inserted properly //otherwise return 0 int search(int v); // search value element v at the proper position in BST. if found //return the index of the location where it is found. Otherwise, //return - };