Review: Array

  • Recall:

    • Program = Algorithm + Data Structure

  • Array:

    • The array is one of the fundamental data structures in Computer Science

  • How are arrays used:

    • Arrays are used to organize multiple data of the same type

    • The array size is fixed after creation

    • Arrays provide fast access to the stored data though an index

    • Searching in an unsorted array takes n steps (linear search)

    • Searching in an sorted array takes log(n) steps (binary search)