Question: How would you sort the array given below using quick sort algorithm? Trace the algorithm and show the array after each step. In every step,
How would you sort the array given below using quick sort algorithm? Trace the algorithm and show the array after each step. In every step, choose the first element as the pivotal.
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 20 | 50 | 10 | 90 | 40 | 30 | 80 | 70 | 60
|
Q1: Consider an array to be searched using sequential. The item we want to search is not present in the array. The time taken by the search is
- O(n) time
- O(n2) time
- O(log(n)) time
- O(1) time
8: In the context of algorithms time complexity, select the best time:
- O(n)
- O(n(log(n)))
- O(log(n))
- O(n2)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
