Data Structures Quiz Flashcards
__________ is the process of arranging a list of items into a defined order based on some criteria.
Sorting
What type does “compareTo” return?
Int
Which of these have the smallest time complexity?
Quick Sort
_______ orders a list of values by repetitively comparing neighboring elements and swapping their positions if necessary.
Bubble Sort
The _____ sort algorithm sorts a list by recursively dividing the list in half until each sub-list has one element and then merging these sub-lists into the sorted order.
Merge Sort
This type of sequential sort algorithm sorts a list by repeatedly placing the next smallest element into its final sorted position.
Selection Sort
The best comparison sort in terms of order is:
O(nlog(n))
the _____ method starts by repeatedly splitting the list in half?
Merge Sort
What is the time complexity of a Quick sort?
nlogn
Merge Sort has time complexity O(___).
nlogn
After one pass on the numbers ( 5 3 9 5 ), what would be the result if you were to use
Bubble Sort?
3 5 5 9
What sorting algorithm has the largest worst-case time complexity?
Quick Sort
the _______ sort divides the array into a sorted and an unsorted region, and iteratively shrinks the unsorted region by picking its first element and inserting it into the correct position in the sorted region
Insertion Sort