Code cleanup (#4246)

This commit is contained in:
HManiac74
2023-07-22 17:23:00 +02:00
committed by GitHub
parent 3facb0d862
commit 2488a2ad51
52 changed files with 50 additions and 167 deletions

View File

@ -3,7 +3,6 @@ package com.thealgorithms.datastructures.hashmap;
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 {
@ -51,7 +50,6 @@ class HashMapCuckooHashingTest {
@Test
void removeNone() {
HashMapCuckooHashing hashTable = new HashMapCuckooHashing(10);
int initialSize = hashTable.getNumberOfKeysInTable();
try {
hashTable.deleteKeyFromHashTable(3);
} catch (Exception e) {
@ -90,11 +88,4 @@ class HashMapCuckooHashingTest {
assertTrue(hashTable.checkTableContainsKey(10));
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};
Arrays.stream(values).forEach(hashTable::insertKey2HashTable);
return hashTable;
}
}

View File

@ -2,7 +2,6 @@ package com.thealgorithms.datastructures.hashmap.hashing;
import static org.junit.jupiter.api.Assertions.*;
import com.thealgorithms.datastructures.hashmap.hashing.MajorityElement;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;