style: format code (#4212)

close #4204
This commit is contained in:
acbin
2023-06-09 18:52:05 +08:00
committed by GitHub
parent ad03086f54
commit 00282efd8b
521 changed files with 5233 additions and 7309 deletions

View File

@@ -93,7 +93,7 @@ class HashMapCuckooHashingTest {
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,17 +1,14 @@
package com.thealgorithms.datastructures.hashmap.hashing;
import com.thealgorithms.datastructures.hashmap.hashing.MajorityElement;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
import com.thealgorithms.datastructures.hashmap.hashing.MajorityElement;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
public class MajorityElementTest{
public class MajorityElementTest {
@Test
void testMajorityWithSingleMajorityElement() {
int[] nums = {1, 2, 3, 9, 9, 6, 7, 8, 9, 9, 9, 9};
@@ -42,7 +39,7 @@ public class MajorityElementTest{
@Test
void testMajorityWithEmptyArray() {
int[] nums = {};
List<Integer> expected = Collections.emptyList();
List<Integer> expected = Collections.emptyList();
List<Integer> actual = MajorityElement.majority(nums);
assertEquals(expected, actual);
}

View File

@@ -1,10 +1,9 @@
package com.thealgorithms.datastructures.hashmap.hashing;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import java.util.Random;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
abstract class MapTest {
abstract <Key extends Comparable<Key>, Value> Map<Key, Value> getMap();