Skip to content

Commit 2a41c5b

Browse files
committed
Adjusting folders
1 parent 7d0a948 commit 2a41c5b

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

Java/Data_Structures/.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>Data_Structures</name>
3+
<name>DSA</name>
44
<comment></comment>
55
<projects>
66
</projects>
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
package lists;
1+
package lists;
2+
3+
import java.security.Key;
24

35
public class Hashtable {
6+
7+
8+
private int hash(Key k) {
9+
10+
int M = 2;
11+
return (k.hashCode() & 0x7fffffff % M);
12+
}
413

514
}

Java/Data_Structures/src/lists/Queue.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,5 +145,17 @@ public static void main(String[] args) {
145145
}
146146
System.out.println("l = " + l);
147147
System.out.println("New size = " + l.size());
148+
149+
l.add(12);
150+
l.add(24);
151+
for(Integer i: l) {
152+
System.out.println(i);
153+
}
154+
155+
try {
156+
System.out.println(l.next());
157+
} catch(Exception e) {
158+
System.out.println(e.getMessage());
159+
}
148160
}
149161
}

0 commit comments

Comments
 (0)