ACM Home Page
Please provide us with feedback. Feedback
A model C++ tree iterator class for binary search trees
Full text PdfPdf (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
SIGCSE: ACM Special Interest Group on Computer Science Education
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 37,   Downloads (12 Months): 146,   Citation Count: 6
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/268084.268114
What is a DOI?

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.