-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
105 lines (72 loc) · 2.25 KB
/
Main.java
File metadata and controls
105 lines (72 loc) · 2.25 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
public class Main {
public static void main(String[] args) throws Exception {
/* DoublyLinkedList list = new DoublyLinkedList() ;
list.FirstInsert(9);
list.FirstInsert(4);
list.FirstInsert(3);
list.FirstInsert(1);
list.LastInsert(45);
list.Insert (1 , 69);
list.Display();
*/
/*CircularLL list = new CircularLL();
list.Insert(34);
list.Insert(32);
list.Insert(43);
list.Insert(3);
list.delete(43);
list.Display();
*/
/*stack s = new stack(5);
s.push (45);
s.push(34);
s.push (4);
s.push(3);
s.push (5);
//s.push(0);
System.out.println(s.pop());
System.out.println(s.pop());
System.out.println(s.pop());
System.out.println(s.pop());
System.out.println(s.pop());
// System.out.println(s.pop());
DynamicStack stack = new DynamicStack(5);
stack.push (45);
stack.push(34);
stack.push (4);
stack.push(3);
stack.push (5);
stack.push(0);
stack st = new DynamicStack(5);
// can use dynamic for reference hence it can get unlimited push ;
*/
/* Queue queue = new Queue(5);
queue.Insert(34);
queue.Insert(34);
queue.Insert(4);
queue.Insert(3);
queue.Insert(0);*/
/* circularQueue q = new circularQueue(5) ;
q.Insert(34);
q.Insert(34);
q.Insert(4);
q.Insert(3);
q.Insert(0);
q.Display();
*/
// BinarySearchTree tree = new BinarySearchTree() ;
// int [] nums = {1,56,21,42,5,34,11,5 ,9};
// tree.populate(nums) ;
/* AVL tree = new AVL() ;
for (int i = 0 ; i <= 1000; i++){
tree.insert(i) ;
}
**/
// HOFFMON ENCODING :--------
/* String que = "abbcda";
HoffmanEncoding hf = new HoffmanEncoding(que);
System.out.println("Encoded String : -" + hf.encode(que));
System.out.println("Decoded String : -" + hf.decode(hf.encode(que)));
*/
}
}