Recently we have been asked to create a hybrid sort based upon quicksorting down to a certain point and insertion sorting from then on. We are to calculate the efficency based upon previous tests. I had very little problems implementing a quicksort algorithm, but for the life of me, I can't get anything to work on the hybrid version. Can anyone help, provide tips or pointers?
Jpowers22 1 Newbie Poster
Recommended Answers
Jump to PostRecently we have been asked to create a hybrid sort based upon quicksorting down to a certain point and insertion sorting from then on. We are to calculate the efficency based upon previous tests. I had very little problems implementing a quicksort algorithm, but for the life of me, I …
Jump to PostOne interesting way to figure out optimizations is through experimentation. You can time each pass for each implementation, record results and then plot them side by side on a graph. You can make adjustments accordingly to the insertion sort version's threshold to see if there's improvements.
Jump to PostNarue,
I checked your excellent sorting snippet, and have a question. Is there a way to time this, milliseconds is much to slow? I know one could increase the size of the array, but that's not challenging. Something like a microsecond or nanosecond timer would help.struct timeval
All 12 Replies
subtronic 1 Junior Poster
Chainsaw 12 Posting Pro in Training
Jpowers22 1 Newbie Poster
Chainsaw 12 Posting Pro in Training
Narue 5,707 Bad Cop Team Colleague
subtronic 1 Junior Poster
Jpowers22 1 Newbie Poster
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
subtronic 1 Junior Poster
Narue 5,707 Bad Cop Team Colleague
Chainsaw 12 Posting Pro in Training
subtronic 1 Junior Poster
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.