You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sequences as ordered sets: each element has specific position or index.
Pairs as sequences: each pair consists of an element and the rest of sequence
Mapping sequences to lists: empty list represents the end of sequence
Operations on sequences: length, access by index, append
Efficiency considerations: trade-offs between time and space efficiency in sequence operations.
2.2.2 Hierarchical Structures
Nested lists as a representation: each element of a list can be either an atomic value or another nested list.
Recursive procedures: can be used to traverse, access the elements of nested lists
Abstraction and hierarchical structures: focus on the overall structure and the relationships between the parts, while hiding the implementation details of individual levels.
Mapping procedures over hierarchical structures
2.2.3 Sequences as Conventional Interfaces
Conventional interfaces: set of procedures and conventions for working with certain types of data
Sequences as conventional interfaces: first, rest, empty?, cons, list
Hierarchical sequences: flatten, treemap
Sequence abstractions: to work with sequence without worrying about the underlying representation
Implement sequences with different data types: arrays, linked lists