Lists

Properties

  • Linear relationship
    Each element except the first has a unique predecessor, and each element except the last has a unique successor.

  • Length
    The number of items in a list; the length can vary over time.

 

Types

  • Unsorted list
    A list in which data items are placed in no particular order; the only relationship between data elements is the list predecessor and successor relationships.
  • Sorted list
    A list that is sorted by the value in the key; there is a semantic relationship among the keys of the items in the list.

    • Key
      The attributes that are used to determine the logical order of the list.

Typical Operations on a List

Unsorted List - example code

Sorted List - example code

 

© Lynne Grewe