Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

Heap sort

Language: Layout:
+ ] Show input
Compilation time: 0,16 sec, absolute running time: 0,13 sec, cpu time: 0,12 sec, average memory usage: 15 Mb, average nr of threads: 3, absolute service time: 0,33 sec 
edit mode |  history  | discussion
Before heap sort, the array is
12 19 15 8 4 6 3 29 9 2 22 44 20 25 
Max heap is
44 29 25 19 22 20 12 8 9 2 4 6 15 3 
Sorted array is
2 3 4 6 8 9 12 15 19 20 22 25 29 44 

    
                
λ
.NET NoSQL database for rapid development