public void encode() /*throws IOException, FileNotFoundException*/{
        //Scanner in = new Scanner(System.in);
        //System.out.println("Enter 0 for String input or 1 for Filename input");
        //int k=in.nextInt();
        
        //System.out.println("Enter the input string: ");
        //input_string = in.nextLine();
        //input_string = in.nextLine();
        
        /*else{
            //C:\Users\Manu\Desktop\Workspace\IntelliJ\HuffmanCoding\src\test.txt
            System.out.print("Enter the filepath: ");
            filename = in.next();
            BufferedReader br= new BufferedReader(new FileReader(filename));
            String line;
            while((line=br.readLine())!=null)
                input_string+=line;
        }*/
        //System.out.println("Input string: "+ input_string);
         //System.out.println("Size occupied by input string(in bytes): "+ ( ip_size=input_string.length()*2));
        // ip_size=input_string.length()*2;
        int freq[] = new int[X];
        pq=null;
        for(int i=0;i<input_string.length();i++)
            freq[input_string.charAt(i)]++;
        for(int i=0;i<X;i++)
            if(freq[i]>0)
                insert(new Pnode((char) i,freq[i],null,null));
        /*System.out.print("Before merging\n");
        display();*/
        while(count>1){
            Pnode x1=delete();
            Pnode x2=delete();
            insert(new Pnode('\0',x1.freq + x2.freq,x1,x2));
        }
        root=delete();
        table = new String[X];
        traverse(root,"");
        encoded_string = "";
        
        //display();
        //System.out.println("*************ENCODED STRING**************");
        for(int i=0;i<input_string.length();i++)
            encoded_string+=table[input_string.charAt(i)];
        //System.out.println("Encoded String: "+encoded_string);
        //encode_ascii(encoded_string);
        /*decode_ascii();
        System.out.println("*************DECODED STRING**************");
        decode();*/
    }