3.10 Lists Summary Notes

List Definition A series of ordered values each stored at a specific index

Lists allow algorithms to work with any number of inputs without changing the code.

NOTE: Pseudocode lists begin at index 1

Using a List

Hover over each item below to learn more.

Linear Search Pseudocode

PROCEDURE linearSearch(list, value)
{
  index ← 1
  REPEAT UNTIL(index > LENGTH(list))
  {
    IF(list[index] = value)
    {
      RETURN(index)
    }
    index ← index + 1
  }
}

Practice problems can be found in this and this Khan Academy link.

Go Back