How does Quick Sort work?
What is the best and worst case time complexity of Quick Sort?
Best: O(nlogn)
Worst: O(n^2)
What is the best and worst case space complexity of Quick Sort?
Best: logn
Worst: n
How does Merge Sort work?
Divide and Conquer (Recursive algorithm)
1. Split the array into the left and right halves and keep on splitting until they reach their individual elements
2. Merge the individual elements into a sorted sublist -> 1 & 3 -> 1,3.
3. With each sorted sublist, compare the first element of each sublist and add the smaller element to a combined list. After adding, increment the index until one of the sublist runs out and add the remaining elements of the other list.
What is the best and worst case time complexity of Merge Sort?
O(nlogn)
What is the best and worst case space complexity of Quick Sort?
log n
How does Insertion Sort work?
What is the best and worst case time complexity of Insertion Sort?
Best: O(n)
Worst: O(n^2)
What is the best and worst case space complexity of Insertion Sort?
Best and Worst: O(1)
How does Bubble Sort work?
What is the best and worst case time complexity of Bubble Sort?
Best: O(n)
Worst: O(n^2)
What is the best and worst case space complexity of Bubble Sort?
Best and Worst: O(1)
How doe Selection Sort work?
What is the best and worst case time complexity of Selection Sort?
best case and worst case: O(n^2)
What is the best and worst case space complexity of Bubble Sort?
best & worst cases: O(1)
Is Selection Sort in-place and stable?
In-place but not stable
Is Insertion Sort in-place and stable?
Both In-place and stable
Is Bubble Sort in-place and stable?
Both In-place and stable
Is Merge Sort in-place and stable?
Not In Place but Stable
Is Radix Sort in-place and stable?
Not In Place but Stable