@@ -0,0 +1,2134 @@
+package com.hackerrank.contests.daysOfCode_30;%0A%0Aimport java.util.LinkedList;%0Aimport java.util.Scanner;%0A%0Aclass Palindrome %7B%0A%09LinkedList%3CCharacter%3E stacks;%0A%09LinkedList%3CCharacter%3E queues;%0A%09%0A%09public Palindrome() %7B%0A%09%09// TODO Auto-generated constructor stub%0A%09%09stacks = new LinkedList%3CCharacter%3E();%0A%09%09queues = new LinkedList%3CCharacter%3E();%0A%09%7D%0A%09%0A%09public void pushCharacter(char c) %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09stacks.push(c);%0A%09%09%0A%09%7D%0A    //Write your code here%0A%0A%09public void enqueueCharacter(char c) %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09queues.addLast(c);%0A%09%09%0A%09%7D%0A%0A%09public Character popCharacter() %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09return (Character) stacks.pop();%0A%09%7D%0A%0A%09public Character dequeueCharacter() %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09return (Character) queues.remove();%0A%09%7D%0A%0A%7D%0A%0Apublic class Day18_QueuesAnsStacks %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09%0A%09%09@SuppressWarnings(%22resource%22)%0A%09%09Scanner sc=new Scanner(System.in);%0A        // read the string s.%0A        String s = sc.nextLine();%0A        %0A        // create the Palindrome class object p.%0A        Palindrome p = new Palindrome();%0A        char arr%5B%5D=s.toCharArray();//Converting string to a character array%0A        // push all the characters of string s to stack.%0A        for (char c : arr) %7B%0A            p.pushCharacter(c);%0A        %7D%0A        %0A        // enqueue all the characters of string s to queue.%0A        for (char c : arr) %7B%0A            p.enqueueCharacter(c);%0A        %7D%0A        %0A        boolean f = true;%0A        %0A        // pop the top character from stack.%0A        // dequeue the first character from queue.%0A        // compare both the characters.%0A        for (int i = 0; i %3C s.length(); i++) %7B%0A%09%09%09if (p.popCharacter() != p.dequeueCharacter()) %7B%0A                f = false;%0A                %0A                break;%0A            %7D%0A        %7D%0A        %0A        // finally print whether string s is palindrome or not.%0A        if (f) %7B%0A            System.out.println(%22The word, %22+s+%22, is a palindrome.%22);%0A        %7D else %7B%0A            System.out.println(%22The word, %22+s+%22, is not a palindrome.%22);%0A        %7D%0A%0A%09%7D%0A%0A%7D%0A

Create Day18_QueuesAnsStacks.java