I have to prepare for a midterm and I am looking for a resource where I can practise the three basic sorting algorithms insertion sort, bubble sort and selection sort a little.

Last year they had to sort an array with n elements and the elements were integers with values between 0 and m-1 and the complexity had to be of O(n+m).

I did not find any good resources as most of them deal with more advanced topics and prepare you for interviews.

So I would be glad if someone could give me a good hint.

  • $\begingroup$ Are you aware that counting sort should have been used last year? $\endgroup$ – John L. Feb 21 '20 at 1:16
  • $\begingroup$ no...we had to come up with the counting sort algorithm by our own. $\endgroup$ – Moe7777 Feb 29 '20 at 16:33

What do you mean by "practice sorting"? Sets of data to sort by hand? Just whip something up with a random number generator. Examples showing how the methods work? At least Wikipedia has detailed algorithms with pretty animations, or search for "algorithm animation", it is quite popular.

  • $\begingroup$ i mean by that sorting practise problems where you have to implement one of the above mentioned sorting algorithms in an exam-like way. $\endgroup$ – Moe7777 Feb 21 '20 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.