I was trying to Compare the 5 Sorting Algorithms using 4 test cases.

Sorting Algorithms

  1. Selection Sort
  2. Insertion Sort
  3. Bubble Sort
  4. Quick Sort
  5. Merge Sort

Test cases

  1. Random Data (completed)
  2. Reverse Sorted Data (completed)
  3. Almost Sorted Data (can't generate Data)
  4. Highly Repetitive Data (can't generate Data)

At first I chose C++ which went to disaster and i finally end up using Octave.
I successfully tested for Random and Reverse Sorted Data .

But in other 2 Couldn't even generate data.....

the what i have done so far have been attached with the post....
i have rename *.m file to *.txt in attachment

I successfully tested for all the test cases
Test cases

  1. Random Data (completed)
  2. Reverse Sorted Data (completed)
  3. Almost Sorted Data (completed)
  4. Highly Repetitive Data (completed)

But Its taking almost too much time...
for n=1 to 200 with increment of 10 it almost took 2 min...

It crossed the max recursion doing till 500 ... :(
Any Idea how to speed up & improve for more than N=5000.

i have attached the new file and graph with the post.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.