Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
trekhleb committed Aug 17, 2018
1 parent 9806012 commit 9834921
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/algorithms/graph/prim/__test__/prim.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('prim', () => {
expect(minimumSpanningTree.getWeight()).toBe(24);
expect(minimumSpanningTree.getAllVertices().length).toBe(graph.getAllVertices().length);
expect(minimumSpanningTree.getAllEdges().length).toBe(graph.getAllVertices().length - 1);
expect(minimumSpanningTree.toString()).toBe('A,B,D,C,E,F,G');
expect(minimumSpanningTree.toString()).toBe('A,B,C,E,D,F,G');
});

it('should find minimum spanning tree for simple graph', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/data-structures/heap/Heap.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ export default class Heap {
nextIndex = this.getLeftChildIndex(currentIndex);
}

if (!this.pairIsInCorrectOrder(
this.heapContainer[nextIndex],
if (this.pairIsInCorrectOrder(
this.heapContainer[currentIndex],
this.heapContainer[nextIndex],
)) {
break;
}
Expand Down

0 comments on commit 9834921

Please sign in to comment.