Assuming the array-based implementation of BSTs in Problem , write and test a function member search () for searching a BST.
Problem ,
In this section, binary search trees were implemented using pointers, but it also is possible to use an array-based implementation, similar to that for linked lists described in Section .
In this implementation, each node is represented as a class Bi n Node and the BST is stored in an array of Bi n Nodes.
Each Bi n Node object contains three data members: one to store data and two link members that point to the left and the right child, respectively, by storing their indices in the array. Imitating the array-based implementation of linked lists in Section, do the following:
a. Write appropriate declarations for this array-based implementation of binary search trees.
b. Design and test a class for maintaining a storage pool of available nodes, with operations to initialize it, to get a node from it, and to return a node to it.