• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/router/busybox-1.x/archival/

Lines Matching refs:heap

30  * 0000047a b heap
857 /* maximum heap size */
871 ush heap[HEAP_SIZE]; /* heap used to build the Huffman trees */
872 int heap_len; /* number of elements in the heap */
875 /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
876 * The same heap array is used to build all trees.
885 * need for the L_CODES extra codes used during heap construction. However
1015 * Restore the heap property by moving down the tree starting at node k,
1017 * when the heap property is re-established (each father smaller than its
1029 int v = G2.heap[k];
1034 if (j < G2.heap_len && SMALLER(tree, G2.heap[j + 1], G2.heap[j]))
1038 if (SMALLER(tree, v, G2.heap[j]))
1042 G2.heap[k] = G2.heap[j];
1048 G2.heap[k] = v;
1055 * IN assertion: the fields freq and dad are set, heap[heap_max] and
1070 int h; /* heap index */
1083 tree[G2.heap[G2.heap_max]].Len = 0; /* root of the heap */
1086 n = G2.heap[h];
1136 m = G2.heap[--h];
1203 /* Remove the smallest element from the heap and recreate the heap with
1204 * one less element. Updates heap and heap_len. */
1207 /* Index within the heap array of least frequent node in the Huffman tree */
1211 top = G2.heap[SMALLEST]; \
1212 G2.heap[SMALLEST] = G2.heap[G2.heap_len--]; \
1221 int n, m; /* iterate over heap elements */
1225 /* Construct the initial heap, with least frequent element in
1226 * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
1227 * heap[0] is not used.
1234 G2.heap[++G2.heap_len] = max_code = n;
1247 int new = G2.heap[++G2.heap_len] = (max_code < 2 ? ++max_code : 0);
1258 /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
1269 m = G2.heap[SMALLEST]; /* m = node of next least frequency */
1271 G2.heap[--G2.heap_max] = n; /* keep the nodes sorted by frequency */
1272 G2.heap[--G2.heap_max] = m;
1284 /* and insert the new node in the heap */
1285 G2.heap[SMALLEST] = node++;
1290 G2.heap[--G2.heap_max] = G2.heap[SMALLEST];