Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1520533

Browse files
committed
Fix issuetrekhleb#315.
1 parent2206158 commit1520533

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎src/data-structures/priority-queue/__test__/PriorityQueue.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,16 @@ describe('PriorityQueue', () => {
5151
expect(priorityQueue.poll()).toBe(5);
5252
});
5353

54-
it('should be possible to change priority ofinternal nodes',()=>{
54+
it('should be possible to change priority ofhead node',()=>{
5555
constpriorityQueue=newPriorityQueue();
5656

5757
priorityQueue.add(10,1);
5858
priorityQueue.add(5,2);
5959
priorityQueue.add(100,0);
6060
priorityQueue.add(200,0);
6161

62+
expect(priorityQueue.peek()).toBe(100);
63+
6264
priorityQueue.changePriority(100,10);
6365
priorityQueue.changePriority(10,20);
6466

@@ -68,14 +70,16 @@ describe('PriorityQueue', () => {
6870
expect(priorityQueue.poll()).toBe(10);
6971
});
7072

71-
it('should be possible to change priority ofhead node',()=>{
73+
it('should be possible to change priority ofinternal nodes',()=>{
7274
constpriorityQueue=newPriorityQueue();
7375

7476
priorityQueue.add(10,1);
7577
priorityQueue.add(5,2);
7678
priorityQueue.add(100,0);
7779
priorityQueue.add(200,0);
7880

81+
expect(priorityQueue.peek()).toBe(100);
82+
7983
priorityQueue.changePriority(200,10);
8084
priorityQueue.changePriority(10,20);
8185

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp