Skip to content

Commit afa551a

Browse files
committed
Fix array indices starting from 2
1 parent bd035f5 commit afa551a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/algorithms/controllers/HashingInsertion.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// XXX could probably do with a restructure!
2-
// Dynamic table size was first implemented in a rather inflexible way wrt what gets
3-
// animated etc. The code has been hacked around to "fix" this but it could do with
4-
// a re-think or at least a clean up!
1+
// XXX could probably do with a restructure; certainly a clean up!
2+
// Dynamic table size was first implemented in a rather inflexible way wrt what
3+
// gets animated etc. The code has been hacked a lot to "fix" this and a
4+
// bunch of other things...
55

66
import Array2DTracer from '../../components/DataStructures/Array/Array2DTracer';
77
import GraphTracer from '../../components/DataStructures/Graph/GraphTracer';

src/components/DataStructures/Array/Array1DRenderer/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ class Array1DRenderer extends Array2DRenderer {
150150
style={{ display: 'flex', justifyContent: 'space-between' }}
151151
>
152152
{longestRow.map((_, i) => {
153-
// if the graph instance is heapsort, then the array index starts from 1
154-
i += 1;
153+
// the array index starts from 1 in most algorithms
154+
// 0 for straightRadixSort (wanted for count array)
155155
if (algo !== "straightRadixSort") {
156156
i += 1;
157157
}

0 commit comments

Comments
 (0)