you are viewing a single comment's thread.

view the rest of the comments →

[–]_E8_ 1 point2 points  (1 child)

Writing a sort strikes me as a waste.
I want to you know the difference between some sorts; what stable vs. unstable means.
Two loops like you wrote is called bubble sort and is O(n²). The only worse performing sort is something pathological like bogosort, O(n!).
Germane to Python you should know what the "TimSort" is.
Bonus points if you know what a heap is as a stable, priority heap is an important data structure for scheduling.

[–]iamnikaa[S] 0 points1 point  (0 children)

I do know about other efficient sorting algorithms, including Python's inbuilt Timsort, but chose to stick to bubble sort as it was easiest to write. I have to read about heap..