Skip to content

Commit bd3b420

Browse files
authored
Merge pull request rage#203 from BenAttenborough/12.2-typos
12.2 typos
2 parents 1bfc0f5 + 265d52f commit bd3b420

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

data/part-12/2-arraylist-and-hashtable.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -769,9 +769,9 @@ public V get(K key) {
769769

770770
List<Pair<K, V>> valuesAtIndex = this.values[hashValue];
771771

772-
for (int i = 0; i < valuesAtINdex.size(); i++) {
772+
for (int i = 0; i < valuesAtIndex.size(); i++) {
773773
if (valuesAtIndex.value(i).getKey().equals(key)) {
774-
return valuesAtindex.value(i).getValue();
774+
return valuesAtIndex.value(i).getValue();
775775
}
776776
}
777777

@@ -843,11 +843,11 @@ public void add(K key, V value) {
843843
values[hashValue] = new List<>();
844844
}
845845

846-
List<Pari<K, V>> valuesAtindex = values[hashValue];
846+
List<Pari<K, V>> valuesAtIndex = values[hashValue];
847847

848848
int index = -1;
849849
for (int i = 0; i < valuesAtIndex.size(); i++) {
850-
if (valuesAtINdex.value(i).getKey().equals(key)) {
850+
if (valuesAtIndex.value(i).getKey().equals(key)) {
851851
index = i;
852852
break;
853853
}
@@ -937,7 +937,7 @@ public void add(K key, V value) {
937937
valuesAtIndex.add(new Pair<>(key, value));
938938
this.firstFreeIndex++;
939939
} else {
940-
valuesAtindex.value(index).setValue(value);
940+
valuesAtIndex.value(index).setValue(value);
941941
}
942942
}
943943
```
@@ -1114,7 +1114,7 @@ Let's give the hash map the functionality to remove a key-value pair based on ke
11141114

11151115
<!-- Voimme hyödyntää valmiiksi toteuttamiamme metodeja poistotoiminnallisuudessa. Selitä itsellesi (ääneen) alla olevan metodin konkreettinen toiminta. -->
11161116

1117-
We can take advantage of the method we've already implemented in the removing method. Explain to yourself (out loud) how the method described below conretely works.
1117+
We can take advantage of the method we've already implemented in the removing method. Explain to yourself (out loud) how the method described below concretely works.
11181118

11191119
<!-- ```java
11201120
public V remove(K avain) {
@@ -1246,7 +1246,7 @@ System.out.println("Hash map: the search took about " + hashMapSearch / 1000000
12461246
<sample-output>
12471247

12481248
List: the search took about 6284 milliseconds (6284420580 nanoseconds.)
1249-
Hajautustaulu: the search took about 0 milliseconds (805106 nanoseconds.)
1249+
Hash map: the search took about 0 milliseconds (805106 nanoseconds.)
12501250

12511251
</sample-output>
12521252

0 commit comments

Comments
 (0)