-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.java
49 lines (45 loc) · 1.17 KB
/
Program.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import math.Factorial;
import ds.Node;
import ds.LinkedList;
import ds.LinkedNode;
import ds.Tree;
import ds.HashMap;
public class Program {
public static void main(String[] args) throws Exception {
print("hello world!");
Factorial f = new Factorial();
int num = f.factorial(3);
/*LinkedList<Integer> ll = new LinkedList<Integer>();
ll.add(2);
ll.add(3);
ll.add(4);
if (ll.testIfPresent(5))
print("something is wrong");
if (!ll.testIfPresent(4))
print("something is wrong");
if (!ll.testIfPresent(3))
print("cannot find 3!");
ll.deleteLast();
if (ll.testIfPresent(4))
print("4 did not go away, something is wrong!");
ll.add(4);
if (!ll.testIfPresent(4))
print("cannot find 4, something wrong");
if (!ll.find(4).equals(4))
print("it's not 4, something wrong");
*/
HashMap hm = new HashMap();
hm.put("cat", "danger");
String t = hm.get("cat");
System.out.println(t);
/*Tree t = new Tree(5);
if (!t.isStump())
print("tree broken");
t.insert(7);
t.insert(8);
t.insert(9);*/
}
public static void print(String msg) {
System.out.println(msg);
}
}