MCPcopy Create free account
hub / github.com/hoothin/UserScripts / smaller

Function smaller

Picviewer CE+/dist.user.js:10922–10927  ·  view source on GitHub ↗
(tree, n, m, depth)

Source from the content-addressed store, hash-verified

10920 * the subtrees have equal frequency. This minimizes the worst case length.
10921 */
10922function smaller(tree, n, m, depth) {
10923 var _n2 = n * 2;
10924 var _m2 = m * 2;
10925 return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||
10926 (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));
10927}
10928
10929/* ===========================================================================
10930 * Restore the heap property by moving down the tree starting at node k,

Callers 1

pqdownheapFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected