Skip to content

Commit 6c6b3fd

Browse files
authored
Merge pull request williamfiset#110 from mehranus/correct-class-name
correct-class-name
2 parents 83b01a6 + a84829e commit 6c6b3fd

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

com/williamfiset/algorithms/datastructures/hashtable/HashTableSeperateChaining.java renamed to com/williamfiset/algorithms/datastructures/hashtable/HashTableSeparateChaining.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public String toString() {
3333
}
3434

3535
@SuppressWarnings("unchecked")
36-
public class HashTableSeperateChaining<K, V> implements Iterable<K> {
36+
public class HashTableSeparateChaining<K, V> implements Iterable<K> {
3737

3838
private static final int DEFAULT_CAPACITY = 3;
3939
private static final double DEFAULT_LOAD_FACTOR = 0.75;
@@ -42,16 +42,16 @@ public class HashTableSeperateChaining<K, V> implements Iterable<K> {
4242
private int capacity, threshold, size = 0;
4343
private LinkedList<Entry<K, V>>[] table;
4444

45-
public HashTableSeperateChaining() {
45+
public HashTableSeparateChaining() {
4646
this(DEFAULT_CAPACITY, DEFAULT_LOAD_FACTOR);
4747
}
4848

49-
public HashTableSeperateChaining(int capacity) {
49+
public HashTableSeparateChaining(int capacity) {
5050
this(capacity, DEFAULT_LOAD_FACTOR);
5151
}
5252

5353
// Designated constructor
54-
public HashTableSeperateChaining(int capacity, double maxLoadFactor) {
54+
public HashTableSeparateChaining(int capacity, double maxLoadFactor) {
5555
if (capacity < 0) throw new IllegalArgumentException("Illegal capacity");
5656
if (maxLoadFactor <= 0 || Double.isNaN(maxLoadFactor) || Double.isInfinite(maxLoadFactor))
5757
throw new IllegalArgumentException("Illegal maxLoadFactor");

javatests/com/williamfiset/algorithms/datastructures/hashtable/HashTableSeperateChainingTest.java renamed to javatests/com/williamfiset/algorithms/datastructures/hashtable/HashTableSeparateChainingTest.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
import static org.junit.Assert.*;
44

5-
import com.williamfiset.algorithms.datastructures.hashtable.HashTableSeperateChaining;
5+
import com.williamfiset.algorithms.datastructures.hashtable.HashTableSeparateChaining;
66
import java.util.*;
77
import org.junit.*;
88

9-
public class HashTableSeperateChainingTest {
9+
public class HashTableSeparateChainingTest {
1010

1111
// You can set the hash value of this object to be whatever you want
1212
// This makes it great for testing special cases.
@@ -39,11 +39,11 @@ public boolean equals(Object o) {
3939
MAX_RAND_NUM = randInt(1, 350);
4040
}
4141

42-
HashTableSeperateChaining<Integer, Integer> map;
42+
HashTableSeparateChaining<Integer, Integer> map;
4343

4444
@Before
4545
public void setup() {
46-
map = new HashTableSeperateChaining<>();
46+
map = new HashTableSeparateChaining<>();
4747
}
4848

4949
@Test(expected = IllegalArgumentException.class)
@@ -53,22 +53,22 @@ public void testNullKey() {
5353

5454
@Test(expected = IllegalArgumentException.class)
5555
public void testIllegalCreation1() {
56-
new HashTableSeperateChaining<>(-3, 0.5);
56+
new HashTableSeparateChaining<>(-3, 0.5);
5757
}
5858

5959
@Test(expected = IllegalArgumentException.class)
6060
public void testIllegalCreation2() {
61-
new HashTableSeperateChaining<>(5, Double.POSITIVE_INFINITY);
61+
new HashTableSeparateChaining<>(5, Double.POSITIVE_INFINITY);
6262
}
6363

6464
@Test(expected = IllegalArgumentException.class)
6565
public void testIllegalCreation3() {
66-
new HashTableSeperateChaining<>(6, -0.5);
66+
new HashTableSeparateChaining<>(6, -0.5);
6767
}
6868

6969
@Test
7070
public void testLegalCreation() {
71-
new HashTableSeperateChaining<>(6, 0.9);
71+
new HashTableSeparateChaining<>(6, 0.9);
7272
}
7373

7474
@Test
@@ -95,7 +95,7 @@ public void testIterator() {
9595
map2.clear();
9696
assertTrue(map.isEmpty());
9797

98-
map = new HashTableSeperateChaining<>();
98+
map = new HashTableSeparateChaining<>();
9999

100100
List<Integer> rand_nums = genRandList(MAX_SIZE);
101101
for (Integer key : rand_nums) assertEquals(map.add(key, key), map2.put(key, key));
@@ -140,11 +140,11 @@ public void testConcurrentModificationException2() {
140140
@Test
141141
public void randomRemove() {
142142

143-
HashTableSeperateChaining<Integer, Integer> map;
143+
HashTableSeparateChaining<Integer, Integer> map;
144144

145145
for (int loop = 0; loop < LOOPS; loop++) {
146146

147-
map = new HashTableSeperateChaining<>();
147+
map = new HashTableSeparateChaining<>();
148148
map.clear();
149149

150150
// Add some random values
@@ -167,7 +167,7 @@ public void randomRemove() {
167167
@Test
168168
public void removeTest() {
169169

170-
HashTableSeperateChaining<Integer, Integer> map = new HashTableSeperateChaining<>(7);
170+
HashTableSeparateChaining<Integer, Integer> map = new HashTableSeparateChaining<>(7);
171171

172172
// Add three elements
173173
map.put(11, 0);
@@ -193,7 +193,7 @@ public void removeTest() {
193193
@Test
194194
public void removeTestComplex1() {
195195

196-
HashTableSeperateChaining<HashObject, Integer> map = new HashTableSeperateChaining<>();
196+
HashTableSeparateChaining<HashObject, Integer> map = new HashTableSeparateChaining<>();
197197

198198
HashObject o1 = new HashObject(88, 1);
199199
HashObject o2 = new HashObject(88, 2);
@@ -224,7 +224,7 @@ public void testRandomMapOperations() {
224224
jmap.clear();
225225
assertEquals(jmap.size(), map.size());
226226

227-
map = new HashTableSeperateChaining<>();
227+
map = new HashTableSeparateChaining<>();
228228

229229
final double probability1 = Math.random();
230230
final double probability2 = Math.random();
@@ -255,7 +255,7 @@ public void testRandomMapOperations() {
255255
@Test
256256
public void randomIteratorTests() {
257257

258-
HashTableSeperateChaining<Integer, LinkedList<Integer>> m = new HashTableSeperateChaining<>();
258+
HashTableSeparateChaining<Integer, LinkedList<Integer>> m = new HashTableSeparateChaining<>();
259259
HashMap<Integer, LinkedList<Integer>> hm = new HashMap<>();
260260

261261
for (int loop = 0; loop < LOOPS; loop++) {
@@ -265,7 +265,7 @@ public void randomIteratorTests() {
265265
assertEquals(m.size(), hm.size());
266266

267267
int sz = randInt(1, MAX_SIZE);
268-
m = new HashTableSeperateChaining<>(sz);
268+
m = new HashTableSeparateChaining<>(sz);
269269
hm = new HashMap<>(sz);
270270

271271
final double probability = Math.random();

0 commit comments

Comments
 (0)