In C++ Implement class Set using a binary search tree by modifying the textbook BinarySearchTree class (Figures
Fantastic news! We've Found the answer you've been seeking!
Question:
In C++
Implement class Set using a binary search tree by modifying
the textbook BinarySearchTree class (Figures 4.16, 4.17, 4.18,
4.20, 4.21, 4.23, 4.26, 4.27, and 4.28) as follows:
1) Add data member Size.
2) Add nested classes const_iterator and iterator with the
same members as those of Figures 3.14 and 3.15.
3) Add methods begin() and end().
4) Add to each node a link to the parent node. (This is
needed by operator++ in the iterators.)
Include a main function that instantiates a set of integers,
Set, and allows an interactive user to execute any
of the member functions and to print the contents of the
set using an iterator (Figure 3.6).
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date: