Question: I've developed a new, super cool sorting algorithm. Here's the procedure: Until sorted: Randomly generate i = some number between 0 and n - 1
I've developed a new, super cool sorting algorithm. Here's the procedure:
Until sorted:
- Randomly generate i = some number between 0 and n - 1 (n = size of array)
- Randomly generate j = some number between i + 1 and n - 1
- if array[i] > array[j], swap
- Check to see if the array has been sorted
List the algorithm's efficiency using Big-O.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
