Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- class switch_case{
- public static void main(String args[]){
- Scanner sc = new Scanner(System.in);
- System.out.println("Press 1 for linear search \nPress 2 for Binary search \nPress 3 for Insertion sort \nPress 4 for Counting sort \nPress 5 for Quicksort\nPress 6 for Merge sort\nPress 7 for KMP\nPress 8 for NaiveString\nPress 9 for lps\nPress 10 for heapsort\nPress 11 for kmp\nPress 12 for prims\nPress 13 for LCS\nPress 14 for BST insertion\nPress 15 for Kruskals\n\n\n\n");
- int input = sc.nextInt();
- if(input == 1){
- new LinearSearch().main(new String[0]);
- }
- if(input == 2){
- new BinarySearch().main(new String[0]);
- }
- if(input == 3){
- new InsertionSort().main(new String[0]);
- }
- if(input == 4){
- new CountSort().main(new String[0]);
- }
- if(input == 5){
- new Quicksort().main(new String[0]);
- }
- if(input == 6){
- new mergesort().main(new String[0]);
- }
- if(input == 7){
- new kmp().main(new String[0]);
- }
- if(input == 8){
- new Naive_string().main(new String[0]);
- }
- if(input == 9){
- new lps().main(new String[0]);
- }
- if(input == 10){
- new HeapSort().main(new String[0]);
- }
- if(input == 11){
- new rabin_karp().main(new String[0]);
- }
- if(input == 12){
- new prims().main(new String[0]);
- }
- if(input == 13){
- new LCS().main(new String[0]);
- }if(input == 14){
- new BstInsert().main(new String[0]);
- }
- if(input == 15){
- new Kruskals().main(new String[0]);
- }
- if(input < 1 && input > 15){
- System.out.println("Wrong choice");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment