Skip to content

Commit 0004fe8

Browse files
committed
🎨 refactor: rename 'PriorityQueue' to 'IPriorityQueue'
1 parent ae8f349 commit 0004fe8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Diff for: packages/priority-queue/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ complexity of the enqueue and dequeue operations are both $O(\log N)$.
8080

8181
## Usage
8282

83-
* `PriorityQueue`
83+
* `IPriorityQueue`
8484

8585
Member | Return | Description
8686
:----------------------:|:-------------:|:---------------------------------------
@@ -97,7 +97,7 @@ complexity of the enqueue and dequeue operations are both $O(\log N)$.
9797
```typescript
9898
export function createPriorityQueue<T>(
9999
cmp: (x: T, y: T) => -1 | 0 | 1 | number,
100-
): PriorityQueue<T>
100+
): IPriorityQueue<T>
101101
```
102102

103103
- `createPriorityQueue<number>((x, y) => x - y)`: The top element has a maximum value.

Diff for: packages/priority-queue/src/index.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Priority queue can insert elements within the complexity of log(N) or remove
55
* the largest element in the queue.
66
*/
7-
export interface PriorityQueue<T> {
7+
export interface IPriorityQueue<T> {
88
/**
99
* Initialize priority queue with initial elements.
1010
* @param elements
@@ -48,7 +48,9 @@ export interface PriorityQueue<T> {
4848
* side of the operator has higher precedence.
4949
* @returns
5050
*/
51-
export function createPriorityQueue<T>(cmp: (x: T, y: T) => -1 | 0 | 1 | number): PriorityQueue<T> {
51+
export function createPriorityQueue<T>(
52+
cmp: (x: T, y: T) => -1 | 0 | 1 | number,
53+
): IPriorityQueue<T> {
5254
const _tree: T[] = [null as unknown as T]
5355
let _size = 0
5456

0 commit comments

Comments
 (0)