GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — AlgorithmVisualizer/algorithm/sorting/quick/basic/code.js at master · lahmer/AlgorithmVisualizer Expand file tree/ Copy pathcode.jsMore file actions 40 lines (37 loc) · 1.05 KB / Copy pathcode.jsFile metadata and controls40 lines (37 loc) · 1.05 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 logger._print('original array = [' + D.join(', ') + ']'); function partition(D, low, high) { var i, j, s; while (high > low) { i = low; j = high; s = D[low]; while (i < j) { tracer._select(high)._select(low)._wait(); while (D[j] > s){ tracer._select(j)._wait(); tracer._deselect(j); j--; } D[i] = D[j]; tracer._notify(i, D[j])._wait()._denotify(i); while (s >= D[i] && i < j){ tracer._select(i)._wait(); tracer._deselect(i); i++; } D[j] = D[i]; tracer._notify(j, D[i])._wait()._denotify(j); tracer._deselect(high)._deselect(low); } D[i] = s; tracer._notify(i, s)._wait(); tracer._denotify(i); partition(D, low, i-1); low = i+1; } } function quicksort(D) { partition(D, 0, D.length-1); } quicksort(D); logger._print('sorted array = [' + D.join(', ') + ']'); |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |