Keywords: current

Next: 2.1 Sequences Up: Elements of Object-Oriented Program Previous: 1.11.3 Exception Handling

# 2. Object-Oriented Data Structures

The traditional programming curriculum focuses far more attention on efficient algorithms than on clean program design. Nearly all existing books on data structures including those that use C++ and Java fail to apply good object-oriented design principles in presenting interesting data structures. In this chapter, we will show how to formulate some of the most common data structures in an object-oriented design framework. Enjoy!

Subsections

- 2.1 Sequences
  - 2.1.1 Arrays
    - 2.1.1.1 Recipes for Processing Arrays
  - 2.1.2 Lists
  - 2.1.3 Immutable Sequences
    - 2.1.3.1 Linked Representation
    - 2.1.3.2 Contiguous Representation
  - 2.1.4 Mutable Sequences
    - 2.1.4.1 Singly-linked Mutable List Representation
  - 2.1.5 List Containers
  - 2.1.6 Quasi-Functional Lists
    - 2.1.6.1 Nested Classes vs. Inner Classes
    - 2.1.6.2 Mutable Visitors
  - 2.1.7 Extended Mutable Lists
    - 2.1.7.1 Formulating Traditional Linked Lists as Objects
    - 2.1.7.2 Spaghetti References (akin to spaghetti code)
    - 2.1.7.3 The Iterator Pattern
  - 2.1.8 An Implementation
    - 2.1.8.1 BiLists and Their Iterators
  - 2.1.9 Alternate Representations of Lists
    - 2.1.9.1 Arrays
  - 2.1.10 Hybrid Representations of Sequences