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

Commit 313d51f

Browse files
Merge pull request #79 from sungmkim93/master
Fix Dijkstra test typo
2 parents 2adccbd + c38908c commit 313d51f

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

‎src/com/jwetherell/algorithms/numbers/Integers.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ public static final boolean powerOfTwoUsingBits(int numberToCheck) {
129129
multiDigits.put(10,"ten");
130130
multiDigits.put(20,"twenty");
131131
multiDigits.put(30,"thirty");
132-
multiDigits.put(40,"fourty");
132+
multiDigits.put(40,"forty");
133133
multiDigits.put(50,"fifty");
134134
multiDigits.put(60,"sixty");
135135
multiDigits.put(70,"seventy");
136136
multiDigits.put(80,"eighty");
137-
multiDigits.put(90,"ninty");
137+
multiDigits.put(90,"ninety");
138138
}
139139

140140
private static final int BILLION = 1000000000;

‎test/com/jwetherell/algorithms/graph/test/Graphs.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ private Graph.CostPathPair<Integer> getIdealDirectedWithNegWeightsPathPair(Direc
361361
}
362362

363363
@Test
364-
public void testDijstraUndirected() {
364+
public void testDijkstraUndirected() {
365365
final UndirectedGraph undirected = new UndirectedGraph();
366366
final Graph.Vertex<Integer> start = undirected.v1;
367367
final Graph.Vertex<Integer> end = undirected.v5;
@@ -372,13 +372,13 @@ public void testDijstraUndirected() {
372372
for (Graph.Vertex<Integer> v : map1.keySet()) {
373373
final Graph.CostPathPair<Integer> path1 = map1.get(v);
374374
final Graph.CostPathPair<Integer> path2 = getIdealUndirectedPath(undirected).get(v);
375-
assertTrue("Dijstra's shortest path error. path1="+path1+" path2="+path2, path1.equals(path2));
375+
assertTrue("Dijkstra's shortest path error. path1="+path1+" path2="+path2, path1.equals(path2));
376376
}
377377

378378
final Graph.CostPathPair<Integer> pair1 = Dijkstra.getShortestPath(undirected.graph, start, end);
379379
assertTrue("No path from " + start.getValue() + " to " + end.getValue(), (pair1 != null));
380380

381-
assertTrue("Dijstra's shortest path error. pair="+pair1+" pair="+getIdealUndirectedPathPair(undirected), pair1.equals(getIdealUndirectedPathPair(undirected)));
381+
assertTrue("Dijkstra's shortest path error. pair="+pair1+" pair="+getIdealUndirectedPathPair(undirected), pair1.equals(getIdealUndirectedPathPair(undirected)));
382382
}
383383
}
384384

@@ -546,14 +546,14 @@ public void testDijkstraDirected() {
546546
for (Graph.Vertex<Integer> v : map1.keySet()) {
547547
final Graph.CostPathPair<Integer> path1 = map1.get(v);
548548
final Graph.CostPathPair<Integer> path2 = getIdealDirectedPath(directed).get(v);
549-
assertTrue("Dijstra's shortest path error. path1="+path1+" path2="+path2, path1.equals(path2));
549+
assertTrue("Dijkstra's shortest path error. path1="+path1+" path2="+path2, path1.equals(path2));
550550
}
551551

552552
final Graph.CostPathPair<Integer> pair1 = Dijkstra.getShortestPath(directed.graph, start, end);
553553
assertTrue("No path from "+start.getValue()+" to "+end.getValue(), (pair1!=null));
554554

555555
// Compare pair
556-
assertTrue("Dijstra's shortest path error. pair1="+pair1+" idealPathPair="+getIdealPathPair(directed), pair1.equals(getIdealPathPair(directed)));
556+
assertTrue("Dijkstra's shortest path error. pair1="+pair1+" idealPathPair="+getIdealPathPair(directed), pair1.equals(getIdealPathPair(directed)));
557557
}
558558

559559
@Test
@@ -579,7 +579,7 @@ public void testBellmanFordDirected() {
579579
}
580580

581581
@Test
582-
public void testDijstraDirectedWihtNegativeWeights() {
582+
public void testDijkstraDirectedWihtNegativeWeights() {
583583
final DirectedWithNegativeWeights directedWithNegWeights = new DirectedWithNegativeWeights();
584584
{ // DIRECTED GRAPH (WITH NEGATIVE WEIGHTS)
585585
final Graph.Vertex<Integer> start = directedWithNegWeights.v1;

‎test/com/jwetherell/algorithms/numbers/test/Numbers.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,17 @@ public void testToEnglish() {
9191
assertTrue("toEnglish error. a="+a+" expected="+check+" got="+english, (check.equals(english)));
9292

9393
a = 199;
94-
check = "one-hundred ninty-nine";
94+
check = "one-hundred ninety-nine";
9595
english = Integers.toEnglish(a);
9696
assertTrue("toEnglish error. a="+a+" expected="+check+" got="+english, (check.equals(english)));
9797

9898
a = Integer.MAX_VALUE; // 2,147,483,647
99-
check = "two-billion one-hundred fourty-seven-million four-hundred eighty-three-thousand six-hundred fourty-seven";
99+
check = "two-billion one-hundred forty-seven-million four-hundred eighty-three-thousand six-hundred forty-seven";
100100
english = Integers.toEnglish(a);
101101
assertTrue("toEnglish error. a="+a+" expected="+check+" got="+english, (check.equals(english)));
102102

103103
a = Integer.MIN_VALUE+1; // -2,147,483,647
104-
check = "negative two-billion one-hundred fourty-seven-million four-hundred eighty-three-thousand six-hundred fourty-seven";
104+
check = "negative two-billion one-hundred forty-seven-million four-hundred eighty-three-thousand six-hundred forty-seven";
105105
english = Integers.toEnglish(a);
106106
assertTrue("toEnglish error. a="+a+" expected="+check+" got="+english, (check.equals(english)));
107107
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /