mirror of
https://github.com/TheAlgorithms/Java.git
synced 2026-03-13 08:40:43 +08:00
Format code with prettier (#3375)
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
package com.thealgorithms.datastructures.hashmap;
|
||||
|
||||
import com.thealgorithms.datastructures.hashmap.hashing.HashMapCuckooHashing;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import com.thealgorithms.datastructures.hashmap.hashing.HashMapCuckooHashing;
|
||||
import java.util.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class HashMapCuckooHashingTest {
|
||||
|
||||
@Test
|
||||
@@ -55,8 +54,7 @@ class HashMapCuckooHashingTest {
|
||||
int initialSize = hashTable.getNumberOfKeysInTable();
|
||||
try {
|
||||
hashTable.deleteKeyFromHashTable(3);
|
||||
}
|
||||
catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
assertTrue(true);
|
||||
return;
|
||||
}
|
||||
@@ -93,12 +91,10 @@ class HashMapCuckooHashingTest {
|
||||
assertTrue(hashTable.checkTableContainsKey(100));
|
||||
}
|
||||
|
||||
|
||||
private HashMapCuckooHashing createHashMapCuckooHashing() {
|
||||
HashMapCuckooHashing hashTable = new HashMapCuckooHashing(10);
|
||||
int[] values = {11, 22, 33, 44, 55, 66, 77, 88, 99, 111, 222};
|
||||
int[] values = { 11, 22, 33, 44, 55, 66, 77, 88, 99, 111, 222 };
|
||||
Arrays.stream(values).forEach(hashTable::insertKey2HashTable);
|
||||
return hashTable;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.thealgorithms.datastructures.hashmap.hashing;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class GenericHashMapUsingArrayListTest {
|
||||
|
||||
@Test
|
||||
void testGenericHashmapWhichUsesArrayAndBothKeyAndValueAreStrings() {
|
||||
GenericHashMapUsingArrayList<String, String> map = new GenericHashMapUsingArrayList<>();
|
||||
@@ -46,4 +47,4 @@ class GenericHashMapUsingArrayListTest {
|
||||
assertEquals("Washington DC", map.get(101));
|
||||
assertTrue(map.containsKey(46));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.thealgorithms.datastructures.hashmap.hashing;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class GenericHashMapUsingArrayTest {
|
||||
|
||||
@Test
|
||||
void testGenericHashmapWhichUsesArrayAndBothKeyAndValueAreStrings() {
|
||||
GenericHashMapUsingArray<String, String> map = new GenericHashMapUsingArray<>();
|
||||
@@ -46,4 +47,4 @@ class GenericHashMapUsingArrayTest {
|
||||
assertEquals("Washington DC", map.get(101));
|
||||
assertTrue(map.containsKey(46));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user