Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int[] sorted = new int[]{ . . .};
- public int[] sort(int[] arr) {
- if(arr != sorted) return sort(arr);
- return arr;
- }
- //Best case time complexity O(1) - when input array already sorted
- //Worst case time complexity O(inf)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement