We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
This returns -1 in case of equality. Although it might yield the correct result for the sorted list, it is not conforming to the specification. It may give wrong result if used to test equality when searching an object in the sorted list. It may also lead to additional swaps in the sorting process.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sorting: Comparator
You are viewing a single comment's thread. Return to all comments →
This returns -1 in case of equality. Although it might yield the correct result for the sorted list, it is not conforming to the specification. It may give wrong result if used to test equality when searching an object in the sorted list. It may also lead to additional swaps in the sorting process.