CSX Exam 1 UPDATED ACTUAL Questions and CORRECT Answers
best case O(1]N^2)
Big O for selection sort avg case O(N^2)
worst case O(N^2)
best case O(N)
Big O for insertion sort avg case O(N^2)
worst case O(N^2)
Big O for merge sort O(nlogn)
best case O(NlogN)
Big O for quick sort avg case O(NlogN)
worst case O(N^2)
best case O(1)
Big O for binary search avg case O(logN)
worst case O(logN)
A sort algorithm that repeatedly scans for the smallest item
in the list and swaps it with the element at the current
Selection sort
index. The index is then incremented, and the process
repeats until the last two elements are sorted.
Each items is take in turn, compare to the items in a sorted
Insertion Sort
list and placed in the correct position. 913 -> 193 -> 139
A list is split into individual lists, these are then combined
Merge Sort
(2 lists at a time).
Takes the first element of the list as a pivot and sorts the
Quick Sort data from equal, less, greater, then takes the sorted list
and sorts again with a new pivot in the less than list
Put() puts a new key value pair in a dictionary
Get() Gets the value of a key
sees if a key has been set in the dictionary, returns true or
Has()
best case O(1]N^2)
Big O for selection sort avg case O(N^2)
worst case O(N^2)
best case O(N)
Big O for insertion sort avg case O(N^2)
worst case O(N^2)
Big O for merge sort O(nlogn)
best case O(NlogN)
Big O for quick sort avg case O(NlogN)
worst case O(N^2)
best case O(1)
Big O for binary search avg case O(logN)
worst case O(logN)
A sort algorithm that repeatedly scans for the smallest item
in the list and swaps it with the element at the current
Selection sort
index. The index is then incremented, and the process
repeats until the last two elements are sorted.
Each items is take in turn, compare to the items in a sorted
Insertion Sort
list and placed in the correct position. 913 -> 193 -> 139
A list is split into individual lists, these are then combined
Merge Sort
(2 lists at a time).
Takes the first element of the list as a pivot and sorts the
Quick Sort data from equal, less, greater, then takes the sorted list
and sorts again with a new pivot in the less than list
Put() puts a new key value pair in a dictionary
Get() Gets the value of a key
sees if a key has been set in the dictionary, returns true or
Has()