You are viewing a single comment's thread. Return to all comments →
You are basically doing insertion sort. Time complexity is going to be O(n^2). There are better solutions with O(n) discuessed in other posts.
Seems like cookies are disabled on this browser, please enable them to open this website
Minimum Swaps 2
You are viewing a single comment's thread. Return to all comments →
You are basically doing insertion sort. Time complexity is going to be O(n^2). There are better solutions with O(n) discuessed in other posts.