-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHomePage.java
More file actions
438 lines (288 loc) · 13.2 KB
/
HomePage.java
File metadata and controls
438 lines (288 loc) · 13.2 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
package com.mycompany.algorithm_final_project;
import java.util.LinkedList;
import java.util.Scanner;
/**
*
* @author israkkayumchowdhury
*/
public class HomePage {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
while (true) {
System.out.println("");
System.out.println("-------------* Available Options *-------------");
System.out.println("");
System.out.println(" 01. Data structure");
System.out.println(" 02. Algorithm");
System.out.println("");
System.out.print(" Choice a suitable option --> ");
int n = s.nextInt();
if (n == 1) {
// Data structure section
System.out.println("");
System.out.println("-------------* Available Options *-------------");
System.out.println("");
System.out.println(" 01. Insertion sort");
System.out.println(" 02. Selection sort");
System.out.println(" 03. Bubble sort");
System.out.println(" 04. Marge sort");
System.out.println(" 05. Quick sort");
System.out.println(" 06. Counting sort");
System.out.println(" 07. Radix sort");
System.out.println(" 08. Heap sort");
System.out.println(" 09. Bin sort");
System.out.println(" 10. Shell sort");
System.out.println(" 11. Linear search");
System.out.println(" 12. Binary search");
System.out.println(" 13. Eulidean GCD algorithm");
System.out.println(" 14. Universal hashing");
System.out.println(" 15. Stack");
System.out.println(" 16. Queue");
System.out.println(" 17. Linked list");
System.out.println(" 18. Fibonacci series");
System.out.println(" 19. Recurrences");
System.out.println("");
System.out.print(" Choice a suitable option --> ");
int a = s.nextInt();
System.out.println("");
switch (a) {
case 1:
// Insertion sort
InsertionSort insertionObj = new InsertionSort();
insertionObj.insertion_sort();
break;
case 2:
// Selection sort
SelectionSort selectionObj = new SelectionSort();
selectionObj.selection_sort();
break;
case 3:
// Bubble sort
BubbleSort bubbleObj = new BubbleSort();
bubbleObj.bubble_sort();
break;
case 4:
// Marge sort
MergeSort mergeObj = new MergeSort();
mergeObj.main_func();
break;
case 5:
// Quick sort
QuickSort qsObj = new QuickSort();
qsObj.main_func();
break;
case 6:
// Counting sort
CountingSort countingObj = new CountingSort();
countingObj.counting_sort();
break;
case 7:
// Radix sort
RadixSort radixObj = new RadixSort();
radixObj.radix_sort();
break;
case 8:
// Heap sort
HeapSort hsObj = new HeapSort();
hsObj.main_func();
break;
case 9:
// Bin sort
BinSort binObj = new BinSort();
binObj.main_func();
break;
case 10:
// Shell sort
ShellSort ssObj = new ShellSort();
ssObj.main_func();
break;
case 11:
// Linear search
LinearSearch lsObj = new LinearSearch();
lsObj.main_func();
break;
case 12:
// Binary search
BinarySearch bsObj = new BinarySearch();
bsObj.main_func();
break;
case 13:
// Euclidean GCD algorithm
EuclideanGCD gcdObj = new EuclideanGCD();
gcdObj.main_func();
break;
case 14:
// Universal hashing
UniversalHashing uhObj = new UniversalHashing();
uhObj.main_func();
break;
case 15:
// Stack
Stack sObj = new Stack();
sObj.main_func();
break;
case 16:
// Queue
Queue qObj = new Queue();
qObj.main_func();
break;
case 17:
// Linked list
LinkedListStruc llObj = new LinkedListStruc();
llObj.main_func();
break;
case 18:
// Fibonacci series
FibonacciSeries fsObj = new FibonacciSeries();
fsObj.main_func();
break;
case 19:
// Recurrences
break;
default:
System.out.println(" *** Invalid Input");
}
System.out.println("");
} else if (n == 2) {
// Algorithm section
System.out.println("");
System.out.println("-------------* Available Options *-------------");
System.out.println("");
System.out.println(" 01. Largest Common Subsequence");
System.out.println(" 02. Optimal Binary Search tree");
System.out.println(" 03. Matrix chain multiplication");
System.out.println(" 04. Strassen's matrix multiplication algorithm");
System.out.println(" 05. Breadth-First Search (BFS)");
System.out.println(" 06. Depth-First Search (DFS)");
System.out.println(" 07. Directed Acyclic Graph (DAG)");
System.out.println(" 08. Longest Increasing Subsequence");
System.out.println(" 09. Topological sort");
System.out.println(" 10. Krushkal's algorithm");
System.out.println(" 11. Prim's algorithm");
System.out.println(" 12. Dijkastra's algorithm");
System.out.println(" 13. Bellman Ford's algorithm");
System.out.println(" 14. Worshall's algorithm");
System.out.println(" 15. (0,1) Knapsack");
System.out.println(" 16. Native string matching algorithm");
System.out.println(" 17. Rabin Krap string matching algorithm");
System.out.println(" 18. Activity selection problem");
System.out.println(" 19. MST algorithm");
System.out.println(" 20. Max flow min cut");
System.out.println("");
System.out.print(" Choice a suitable option --> ");
int b = s.nextInt();
System.out.println("");
switch (b) {
case 1:
// Longest Common Subsequence
LongestCommonSubsequence lcsObj = new LongestCommonSubsequence();
lcsObj.main_func();
break;
case 2:
// Optimal Binary Search tree
OptimalBinarySearchTree OBSTObj = new OptimalBinarySearchTree();
OBSTObj.main_func();
break;
case 3:
// Matrix Chain Multiplication
MatrixChainMultiplication matrixObj = new MatrixChainMultiplication();
matrixObj.main_method();
break;
case 4:
// Strassen's Matrix Multiplication Algorithm
StrassensMatrixMultiplication smmObj = new StrassensMatrixMultiplication();
smmObj.main_func();
break;
case 5:
// BFS
BFS bfsObj = new BFS();
bfsObj.bfs_graph();
break;
case 6:
// DFS
DFS dfsObj = new DFS();
dfsObj.dfs_graph();
break;
case 7:
// DAG
DirectAcyclicGraph dagObj = new DirectAcyclicGraph();
dagObj.main_func();
break;
case 8:
// Longest Increasing Subsequence
LongestIncreasingSubsequence lisObj = new LongestIncreasingSubsequence();
lisObj.main_func();
break;
case 9:
// Topological sort
TopologicalSort tsObj = new TopologicalSort();
tsObj.main_func();
break;
case 10:
// Krushkal's algorithm
Kruskals krusObj = new Kruskals();
krusObj.main_func();
break;
case 11:
// Prim's algorithm
// Prims pObj = new Prims();
Kruskals pObj = new Kruskals();
pObj.main_func();
break;
case 12:
// Dijkastra's algorithm
Dijkstra dObj = new Dijkstra();
dObj.main_func();
break;
case 13:
// Bellman Ford's algorithm
BellmanFord bfObj = new BellmanFord();
bfObj.main_func();
break;
case 14:
// Worshall's algorithm
FloydWarshall fwObj = new FloydWarshall();
fwObj.main_func();
break;
case 15:
// (0,1) KKnapsack problem
ZeroOneKnapsack knapsackObj = new ZeroOneKnapsack();
knapsackObj.main_func();
break;
case 16:
// Naive string matching algorithm
NaiveStringMatching nsmObj = new NaiveStringMatching();
nsmObj.main_func();
break;
case 17:
// Rabin krap string matching algorithm
RabinKarpMatching rkmObj = new RabinKarpMatching();
rkmObj.main_func();
break;
case 18:
// Activity selection problem
ActivitySelection asObj = new ActivitySelection();
asObj.main_func();
break;
case 19:
// MST algorithm
Kruskals mstObj = new Kruskals();
mstObj.main_func();
break;
case 20:
// Max flow min cut
MaxFlowMinCut mfmcObj = new MaxFlowMinCut();
mfmcObj.main_func();
break;
default:
System.out.println(" *** Invalid Input");
}
System.out.println("");
} else {
System.out.println("");
System.out.println(" *** Please Enter Valid Input");
System.out.println("");
}
}
}
}