Searching/Sorting

  1. T/F: A binary search requires the list to be in sorted order.
  2. Which type of search walks through the list until the key is found?
    a) Linear b) Binary c) Quick d) Hash
  3. Given the following array of integers, show the array status after each iteration using Selection Sort
    9 1 8 3 7 5
  4. Given the following array of integers, show the array status after each iteration using Insertion Sort
    9 1 8 3 7 5
  5. Given the following array of integers, show the array status after each iteration using Bubble Sort
    9 1 8 3 7 5
  6. Write a function that swaps the positions of two elements in an integer array.