Skip to content

Commit a1d0b98

Browse files
📚 docs: Improve.
1 parent 2d1369b commit a1d0b98

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
[js-heapq](https://data-structures-and-algorithms.github.io/heapq)
1+
:vertical_traffic_light:
2+
[@data-structure/heapq](https://data-structures-and-algorithms.github.io/heapq)
23
==
34

45
Python's heap and priority queue library for JavaScript. Parents are
@@ -8,7 +9,7 @@ and
89

910

1011
```js
11-
let {
12+
import {
1213
heapify ,
1314
heappop ,
1415
heappush ,
@@ -17,7 +18,7 @@ let {
1718
merge ,
1819
nlargest ,
1920
nsmallest ,
20-
} = heapq ;
21+
} from '@data-structure/heapq' ;
2122
```
2223

2324
[![License](https://img.shields.io/github/license/data-structures-and-algorithms/heapq.svg)](https://raw.githubusercontent.com/data-structures-and-algorithms/heapq/main/LICENSE)
@@ -35,6 +36,6 @@ let {
3536
[![Documentation](https://data-structures-and-algorithms.github.io/heapq/badge.svg)](https://data-structures-and-algorithms.github.io/heapq/source.html)
3637
[![Package size](https://img.shields.io/bundlephobia/minzip/@data-structures-and-algorithms/heapq)](https://bundlephobia.com/result?p=@data-structures-and-algorithms/heapq)
3738

38-
## References
39+
## :scroll: References
3940

4041
- [Python's heapq library](https://docs.python.org/3.6/library/heapq.html).

doc/manual/example.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ See Python's docs:
66
## Changes w.r.t. Python's API
77

88
```js
9-
let array = [ 2 , 1 , 3 ] ;
10-
let heap = heapq.heapify( compare.increasing , array ) ;
9+
import {heapify, heappop} from '@data-structure/heapq';
10+
import {increasing} from '@total-order/primitive';
11+
let array = [2, 1, 3];
12+
let heap = heapify(increasing, array);
1113
array[0] ; // 1
12-
heapq.heappop( heap ) ; // 1
13-
heapq.heappop( heap ) ; // 2
14-
heapq.heappop( heap ) ; // 3
14+
heappop( heap ) ; // 1
15+
heappop( heap ) ; // 2
16+
heappop( heap ) ; // 3
1517
array.length ; // 0
1618
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@data-structures-and-algorithms/heapq",
2+
"name": "@data-structure/heapq",
33
"description": "Python's heap and priority queue library for JavaScript",
44
"version": "3.1.0",
55
"license": "AGPL-3.0",

0 commit comments

Comments
 (0)