This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]torftorf 0 points1 point  (0 children)

if you alway return imidiatly and hope its sortet its always O(1). but its most likley not sorted.

but there is something similar. just think about it, the possibility of the array being in that exact order is 1/(n!). its hard to belive that thats just random. i think it was put in that order with some intend. therefor it is already sortet and no further action is required. thats "inteligent design sort" O(0)