MCPcopy Create free account
hub / github.com/TruthHun/BookStack / smaller

Function smaller

static/word2md/mammoth.browser.js:22904–22909  ·  view source on GitHub ↗
(tree, n, m, depth)

Source from the content-addressed store, hash-verified

22902 * the subtrees have equal frequency. This minimizes the worst case length.
22903 */
22904function smaller(tree, n, m, depth) {
22905 var _n2 = n * 2;
22906 var _m2 = m * 2;
22907 return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||
22908 (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));
22909}
22910
22911/* ===========================================================================
22912 * 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