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:

  1. Randomly generate i = some number between 0 and n - 1 (n = size of array)
  2. Randomly generate j = some number between i + 1 and n - 1
  3. if array[i] > array[j], swap
  4. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!