0

So I have been trying to implement a sorting algorithm in assembly. Unfortunatelly, I wasnt able to implement one of the "popular" ones, such as insertion sort, bubble sort and so on. At least not yet. I have instead managed to implement one by just writing the code that came to my head, and it works. However, I would very much like to know if this is an already existing algorithm (mind you, I suck at algorithms), and how good/bad it is. The algorithm works something like this:

  • Traverse the whole arrray and find the smallest number.
  • Switch the first number in the array with the smallest number found.
  • Go back to the second entry in the array and traverse it again to find the smallest number.
  • Switch it with the second, and so on...

This is a simplified description but I think you should be able to understand it. If I were to be honest, this algorithm does not sound pretty efficient to me. But I needed the opinion of people who are more knowledgeable at this then me.

0

1 Answer 1

1

The algorithm you've implemented is called selection sort.

Note I would not say that bubble sort is "one of the popular ones". Bubble sort is quite inefficient, and never used in actual practice.

Sign up to request clarification or add additional context in comments.

1 Comment

I see. Thank you. Have been trying to found which algorithm this was and just couldnt. But yes, this is very much like selection sort. I did use quotation marks when writing popular however.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.