| A model C++ tree iterator class for binary search trees |
| Full text |
Pdf
(532 KB)
|
| Source
|
Technical Symposium on Computer Science Education
archive
Proceedings of the twenty-eighth SIGCSE technical symposium on Computer science education
table of contents
San Jose, California, United States
Pages: 72 - 76
Year of Publication: 1997
ISBN:0-89791-889-4
Also published in ...
|
|
Author
|
|
Richard Rasala
|
Northeastern University, College of Computer Science, Boston, MA
|
|
| Sponsor |
|
| Publisher |
|
| Bibliometrics |
Downloads (6 Weeks): 37, Downloads (12 Months): 146, Citation Count: 6
|
|
|
ABSTRACT
In object-oriented design, the concept of a container class that holds a collection of similar objects is fundamental. To use a container class most effectively, it is helpful to define one or more associated iterator classes that can return the objects in the container class in a specified order. An iterator is a bridge that permits the caller to use the objects in a container without knowledge of the details of how the objects are stored in the container. Although the concept of iterator is discussed in a number of books on C++ and/or object-oriented design, it is difficult to find a complete example that is both elegant and sophisticated. In this article, we provide such an example by developing an iterator class for binary search trees that is capable of doing all standard traversals: inorder, preorder, and postorder.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
|