 ;; with this HEAP-SORT becomes a pie @implementation
 ;;;;;;;;
 (set! *warn-on-reflection* true)
-(def nums (shuffle (range 0 10000)))
+(def nums (shuffle (range 0 100000)))
 nums
 
 (time

                 ;; no attention required
                 (recur first-idxs)
))))))))
(heapify [3 4 1 2 6 9 5 7 8]) ;; [1, 2, 3, 4, 6, 9, 5, 7, 8] => OK
(heapify [12 8 7 6 5 11 4 2 3 1 10]) ;; [1, 2, 4, 3, 5, 11, 7, 6, 12, 8, 10] => OK

  (def s (heap-sort-by-heapify nums)))
s

;;;;;;;;;;;;;;;
;; ANALYSING & IMPROVING the running times.....
;;;;;;;;;;;;;;;
(time
  (def a (reduce (fn [acc x] (.add acc x) acc) (ArrayList.) (range 0 100000))))
;; producing a new ArrayList with 100K items requires:: "Elapsed time: 142.279817 msecs"
