Sort any array in time O(n) ???

Revision en1, by LongQuan, 2016-01-14 19:03:04

I try sort any number array with complexity O(n). I have adjusted Counting sort. 1. I divide input into 2 case: negative array case and positive array case 2. I sort and combine 2 array in 2 case 3. get output

=> complexity O(n)

- GIVE ME YOUR BUG?

code here: my Code

Tags sorting, o(n), counting sort

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English LongQuan 2016-01-14 19:03:04 383 Initial revision (published)