Skip to content

Latest commit

 

History

History

2.2-Hierarchical-Data-and-the-Closure-Property

2.2.1 Representing Sequences

  1. Sequences as ordered sets: each element has specific position or index.
  2. Pairs as sequences: each pair consists of an element and the rest of sequence
  3. Mapping sequences to lists: empty list represents the end of sequence
  4. Operations on sequences: length, access by index, append
  5. Efficiency considerations: trade-offs between time and space efficiency in sequence operations.

2.2.2 Hierarchical Structures

  1. Nested lists as a representation: each element of a list can be either an atomic value or another nested list.
  2. Recursive procedures: can be used to traverse, access the elements of nested lists
  3. Abstraction and hierarchical structures: focus on the overall structure and the relationships between the parts, while hiding the implementation details of individual levels.
  4. Mapping procedures over hierarchical structures

2.2.3 Sequences as Conventional Interfaces

  1. Conventional interfaces: set of procedures and conventions for working with certain types of data
  2. Sequences as conventional interfaces: first, rest, empty?, cons, list
  3. Hierarchical sequences: flatten, treemap
  4. Sequence abstractions: to work with sequence without worrying about the underlying representation
  5. Implement sequences with different data types: arrays, linked lists

2.2.4 Example: A Picture Language