Format code with prettier (#3375)

This commit is contained in:
acbin
2022-10-03 17:23:00 +08:00
committed by GitHub
parent 32b9b11ed5
commit e96f567bfc
464 changed files with 11483 additions and 6189 deletions

View File

@@ -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;
}
}
}

View File

@@ -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));
}
}
}

View File

@@ -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));
}
}
}