You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (valuesAtIndex.value(i).getKey().equals(key)) {
774
-
returnvaluesAtindex.value(i).getValue();
774
+
returnvaluesAtIndex.value(i).getValue();
775
775
}
776
776
}
777
777
@@ -843,11 +843,11 @@ public void add(K key, V value) {
843
843
values[hashValue] =newList<>();
844
844
}
845
845
846
-
List<Pari<K, V>>valuesAtindex= values[hashValue];
846
+
List<Pari<K, V>>valuesAtIndex= values[hashValue];
847
847
848
848
int index =-1;
849
849
for (int i =0; i < valuesAtIndex.size(); i++) {
850
-
if (valuesAtINdex.value(i).getKey().equals(key)) {
850
+
if (valuesAtIndex.value(i).getKey().equals(key)) {
851
851
index = i;
852
852
break;
853
853
}
@@ -937,7 +937,7 @@ public void add(K key, V value) {
937
937
valuesAtIndex.add(newPair<>(key, value));
938
938
this.firstFreeIndex++;
939
939
} else {
940
-
valuesAtindex.value(index).setValue(value);
940
+
valuesAtIndex.value(index).setValue(value);
941
941
}
942
942
}
943
943
```
@@ -1114,7 +1114,7 @@ Let's give the hash map the functionality to remove a key-value pair based on ke
1114
1114
1115
1115
<!-- Voimme hyödyntää valmiiksi toteuttamiamme metodeja poistotoiminnallisuudessa. Selitä itsellesi (ääneen) alla olevan metodin konkreettinen toiminta. -->
1116
1116
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.
1118
1118
1119
1119
<!-- ```java
1120
1120
public V remove(K avain) {
@@ -1246,7 +1246,7 @@ System.out.println("Hash map: the search took about " + hashMapSearch / 1000000
1246
1246
<sample-output>
1247
1247
1248
1248
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.)
0 commit comments