diff --git a/Dictionary.java b/Dictionary.java new file mode 100644 index 0000000..8ec0563 --- /dev/null +++ b/Dictionary.java @@ -0,0 +1,146 @@ +package logic; + + +import java.util.Scanner; + +import logic.Trie; + +public class Dictionary +{ + public static void main(String [] args) + { + + int choice = 0; + Trie Dictionary=new Trie(); + Scanner sc=new Scanner(System.in); + int n = 0; + + do + { + + do + { + + System.out.println("\n\tM E N U"); + System.out.println("*******************************"); + System.out.println("1. INSERT A WORD"); + System.out.println("2. SEARCH A WORD"); + System.out.println("3. DELETE A WORD"); + System.out.println("4. UPDATE MEANING OF A WORD"); + System.out.println("5. DISPLAY WITH A PREFIX"); + System.out.println("6. DISPLAY ALL THE WORDS"); + System.out.println("0. EXIT"); + System.out.println("*******************************"); + System.out.print("Enter choice : "); + if(sc.hasNextInt()) + { + choice = sc.nextInt(); + } + + }while(choice<0 || choice>6); + + switch(choice) + { + case 1 : + System.out.print("\n Enter the number of words you want to insert : "); + + n =sc.nextInt(); + for(int i=0;i