Test output for treap [ok]
Testing time: 0s
/home/mario/local/chicken-4.8.0.3/bin/csi -script run.scm < /dev/null -- testing --> Sorting of a set of numbers via a treap ----------------------- (treap 'empty?) ...................................................... [ PASS] (zero? (treap 'size)) ................................................ [ PASS] (zero? (treap 'depth)) ............................................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] treap depth: 7 The treap contains 12 nodes level 5 (-1 . 0), kids (#f . #f), prio 18974 level 4 (0 . 1), kids (#t . #t), prio 16125 level 6 (1 . 2), kids (#f . #f), prio 26786 level 5 (2 . 3), kids (#t . #t), prio 25456 level 6 (3 . 4), kids (#f . #f), prio 31560 level 3 (4 . 5), kids (#t . #f), prio 11134 level 2 (5 . 6), kids (#t . #t), prio 8992 level 3 (6 . 7), kids (#f . #f), prio 13304 level 1 (7 . 8), kids (#t . #f), prio 2482 level 0 (8 . 9), kids (#t . #t), prio 67 level 1 (9 . 10), kids (#f . #t), prio 9426 level 2 (10 . 11), kids (#f . #f), prio 12002 (treap 'size) ........................................................ [ PASS] (not (treap 'empty?)) ................................................ [ PASS] (treap 'get-min) ..................................................... [ PASS] (treap 'get-max) ..................................................... [ PASS] (treap 'get-min) ..................................................... [ PASS] (treap 'get-max) ..................................................... [ PASS] ((treap 'get) (++ min-key)) .......................................... [ PASS] ((treap 'get) (++ min-key) #f) ....................................... [ PASS] (not ((treap 'get) (-- min-key) #f)) ................................. [ PASS] (treap 'empty?) ...................................................... [ PASS] (zero? (treap 'size)) ................................................ [ PASS] (zero? (treap 'depth)) ............................................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] treap depth: 6 The treap contains 12 nodes level 2 (-1 . 0), kids (#f . #f), prio 19163 level 1 (0 . 1), kids (#t . #t), prio 7039 level 3 (1 . 2), kids (#f . #t), prio 11785 level 5 (2 . 3), kids (#f . #f), prio 31343 level 4 (3 . 4), kids (#t . #f), prio 14606 level 2 (4 . 5), kids (#t . #t), prio 8558 level 3 (5 . 6), kids (#f . #t), prio 22201 level 4 (6 . 7), kids (#f . #f), prio 27871 level 0 (7 . 8), kids (#t . #t), prio 4841 level 2 (8 . 9), kids (#f . #t), prio 11813 level 3 (9 . 10), kids (#f . #f), prio 21116 level 1 (10 . 11), kids (#t . #f), prio 6388 (treap 'get-min) ..................................................... [ PASS] (treap 'delete-min!) ................................................. [ PASS] (not ((treap 'get) min-key #f)) ...................................... [ PASS] (treap 'get-min) ..................................................... [ PASS] (treap 'get-max) ..................................................... [ PASS] (treap 'delete-max!) ................................................. [ PASS] (not ((treap 'get) max-key #f)) ...................................... [ PASS] ((treap 'get) (-- max-key)) .......................................... [ PASS] (+ -2 (++ (- max-key min-key))) ...................................... [ PASS] ((treap 'get) i #f) .................................................. [ PASS] (treap 'delete-min!) ................................................. [ PASS] (not ((treap 'get) i #f)) ............................................ [ PASS] ((treap 'get) i #f) .................................................. [ PASS] (treap 'delete-min!) ................................................. [ PASS] (not ((treap 'get) i #f)) ............................................ [ PASS] ((treap 'get) i #f) .................................................. [ PASS] (treap 'delete-min!) ................................................. [ PASS] (not ((treap 'get) i #f)) ............................................ [ PASS] ((treap 'get) i #f) .................................................. [ PASS] (treap 'delete-min!) ................................................. [ PASS] (not ((treap 'get) i #f)) ............................................ [ PASS] ((treap 'get) i #f) .................................................. [ PASS] (treap 'delete-min!) ................................................. [ PASS] (not ((treap 'get) i #f)) ............................................ [ PASS] ((treap 'get) i #f) .................................................. [ PASS] (treap 'delete-min!) ................................................. [ PASS] (not ((treap 'get) i #f)) ............................................ [ PASS] ((treap 'get) i #f) .................................................. [ PASS] (treap 'delete-min!) ................................................. [ PASS] (not ((treap 'get) i #f)) ............................................ [ PASS] ((treap 'get) i #f) .................................................. [ PASS] (treap 'delete-min!) ................................................. [ PASS] (not ((treap 'get) i #f)) ............................................ [ PASS] ((treap 'get) i #f) .................................................. [ PASS] (treap 'delete-min!) ................................................. [ PASS] (not ((treap 'get) i #f)) ............................................ [ PASS] ((treap 'get) i #f) .................................................. [ PASS] (treap 'delete-min!) ................................................. [ PASS] (not ((treap 'get) i #f)) ............................................ [ PASS] (treap 'empty?) ...................................................... [ PASS] (zero? (treap 'size)) ................................................ [ PASS] (zero? (treap 'depth)) ............................................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) j (cdr (compute-assoc j)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) j (cdr (compute-assoc j)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) j (cdr (compute-assoc j)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) j (cdr (compute-assoc j)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) j (cdr (compute-assoc j)))) ...................... [ PASS] (not ((treap 'put!) i (cdr (compute-assoc i)))) ...................... [ PASS] (not ((treap 'put!) j (cdr (compute-assoc j)))) ...................... [ PASS] ((treap 'get) a-key) ................................................. [ PASS] ((treap 'put!) a-key (cdr new-assoc)) ................................ [ PASS] ((treap 'get) a-key) ................................................. [ PASS] ((treap 'delete!) a-key) ............................................. [ PASS] (not ((treap 'delete!) a-key #f)) .................................... [ PASS] (not ((treap 'put!) a-key (cdr old-assoc))) .......................... [ PASS] ((treap 'put!) a-key (cdr old-assoc)) ................................ [ PASS] ((treap 'get) a-key) ................................................. [ PASS] (++ (- max-key min-key)) ............................................. [ PASS] treap depth: 5 (not (treap 'empty?)) ................................................ [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (++ max-key) ......................................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (compute-assoc expected-key) ......................................... [ PASS] (-- min-key) ......................................................... [ PASS] 129 tests completed in 0.008 seconds. 129 out of 129 (100%) tests passed. -- done testing --> Sorting of a set of numbers via a treap ------------------