954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

GNU Octave: Sorting Analysis : Generate Data

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

Sorting AlgorithmsSelection Sort
Insertion Sort
Bubble Sort
Quick Sort
Merge Sort

Test cases Random Data (completed)
Reverse Sorted Data (completed)
Almost Sorted Data (can't generate Data)
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

Attachments Sort.Analysisplot1_.png 31.2KB SortAnalysis1.txt (3.39KB)
Rhohitman
Junior Poster in Training
86 posts since Dec 2007
Reputation Points: 10
Solved Threads: 5
 

I successfully tested for all the test cases
Test casesRandom Data (completed)
Reverse Sorted Data (completed)
Almost Sorted Data (completed)
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.

Attachments SortAnalysis1.txt (5.02KB) Screenshot-Untitled_Window.png 26.02KB
Rhohitman
Junior Poster in Training
86 posts since Dec 2007
Reputation Points: 10
Solved Threads: 5
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: