File tree Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 29
29
[ ![ GitHub issues] ( http://img.shields.io/github/issues/aureooms/js-heapq.svg?style=flat )] ( https://github.com/aureooms/js-heapq/issues )
30
30
[ ![ Documentation] ( https://aureooms.github.io/js-heapq/badge.svg )] ( https://aureooms.github.io/js-heapq/source.html )
31
31
32
- ## Changes w.r.t. Python's API
33
-
34
- ``` js
35
- let array = [ 2 , 1 , 3 ] ;
36
- let heap = heapq .heapify ( compare .increasing , array ) ;
37
- array[0 ] ; // 1
38
- heapq .heappop ( heap ) ; // 1
39
- heapq .heappop ( heap ) ; // 2
40
- heapq .heappop ( heap ) ; // 3
41
- array .length ; // 0
42
- ```
43
-
44
32
## References
45
33
46
34
- [ Python's heapq library] ( https://docs.python.org/3.6/library/heapq.html ) .
Original file line number Diff line number Diff line change 1
1
See Python's docs:
2
2
3
- - [ collections] ( https://docs.python.org/3.6/library/collections.html )
4
3
- [ heapq] ( https://docs.python.org/3.6/library/heapq.html )
5
- - [ bisect] ( https://docs.python.org/3.6/library/bisect.html )
4
+
5
+ ## Changes w.r.t. Python's API
6
+
7
+ ``` js
8
+ let array = [ 2 , 1 , 3 ] ;
9
+ let heap = heapq .heapify ( compare .increasing , array ) ;
10
+ array[0 ] ; // 1
11
+ heapq .heappop ( heap ) ; // 1
12
+ heapq .heappop ( heap ) ; // 2
13
+ heapq .heappop ( heap ) ; // 3
14
+ array .length ; // 0
15
+ ```
You can’t perform that action at this time.
0 commit comments