23.7.95 Heap Sort for the HP48g/s/x --------------------------- version: Hsort v1.0 Stack: 1: array -> 1: sorted array Keys: ON exists. Leaves partially sorted array. Author: Tamir Demri -> s2543671@techst02.technion.ac.il (until 2/96) checksum: #DE4D , 186.5 bytes after quicksort here's heap sort. its complexity is O(nlogn) although it isn't recursive. the prog is a bang type and that means you need 0 bytes free to sort the array. but LASTARG and the others will not work. NEWOBing will solve this problem (see source code). in qsort.zip (ftp.cis.com -> pub/hp48g/uploads) I wrote a version that also excepts a list. you can disassemble and use the relevant parts. time: it's ml so it's very fast ( but slower than quicksort ) the arrays consist of random values array size time (sec) .8K 100 0.23 2.4K 300 0.85 4.8K 600 1.87 8K 1000 3.36 12K 1500 5.48 16K 2000 7.45 Bugs: I like to know about them this prog is FREEWARE ( source code is in the pack- Jazz style ) and in fact I will be glad if it will be used,changed,improved etc. but anyway I'm not responsible to anything. note that it was tested only on HP48GX-P (but should work on all versions.) -/\/\/\/\/- Tamir Demri s2543671@techst02.technion.ac.il (good until 2/96)