MCPcopy Create free account
hub / github.com/course-dasheng/fe-algorithm / constructor

Method constructor

interview/502.ipo.js:17–20  ·  view source on GitHub ↗
(compare)

Source from the content-addressed store, hash-verified

15
16 class Heap{
17 constructor(compare){
18 this.arr = [0] //忽略0这个索引
19 this.compare = compare?compare:(a,b)=>a>b
20 }
21 get size(){
22 return this.arr.length-1
23 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected