Lines Matching refs:root
28 /* Sifts a broken heap. The input array is a heap from root to bottom
29 * except that the root entry may be out of place.
31 * Sinks a hole from array[root] to leaf and then sifts the original array[root] element
37 * the potentially out of place root entry value is expected to be small.
39 * @param root the one based index into array of the out-of-place root of the heap.
43 void SkTHeapSort_SiftUp(T array[], size_t root, size_t bottom, C lessThan) {
44 T x = array[root-1];
45 size_t start = root;
46 size_t j = root << 1;
51 array[root-1] = array[j-1];
52 root = j;
53 j = root << 1;
55 j = root >> 1;
58 array[root-1] = array[j-1];
59 root = j;
60 j = root >> 1;
65 array[root-1] = x;
68 /* Sifts a broken heap. The input array is a heap from root to bottom
69 * except that the root entry may be out of place.
71 * Sifts the array[root] element from the root down.
73 * @param root the one based index into array of the out-of-place root of the heap.
77 void SkTHeapSort_SiftDown(T array[], size_t root, size_t bottom, C lessThan) {
78 T x = array[root-1];
79 size_t child = root << 1;
85 array[root-1] = array[child-1];
86 root = child;
87 child = root << 1;
92 array[root-1] = x;