Skip to main content
added 5 characters in body
Source Link
cpri
  • 707
  • 1
  • 7
  • 8

C

C

int is_sorted(int *T, int n) { return false; } 

Works with probability 1-(1/n!) and complexity O(1). Obviously the best method for very large random arrays.

As the complexity is only O(1), for a better estimation, run twice.

C

int is_sorted(int *T, int n) { return false; } 

Works with probability 1-(1/n!) and complexity O(1). Obviously the best method for very large random arrays.

As the complexity is only O(1), for a better estimation, run twice.

C

int is_sorted(int *T, int n) { return false; } 

Works with probability 1-(1/n!) and complexity O(1). Obviously the best method for very large random arrays.

As the complexity is only O(1), for a better estimation, run twice.

Source Link
cpri
  • 707
  • 1
  • 7
  • 8

C

int is_sorted(int *T, int n) { return false; } 

Works with probability 1-(1/n!) and complexity O(1). Obviously the best method for very large random arrays.

As the complexity is only O(1), for a better estimation, run twice.