Palindrome Programme
Palindrome Programme
Scanner;
this.maxSize = size;
front = 0;
rear = -1;
currentSize = 0;
top = 0;
if(isQueueFull()){
System.out.println("Queue is full!");
return;
}
rear = -1;
queueArray[++rear] = item;
currentSize++;
stackArray[top] = item1;
top++;
if(isQueueEmpty()){
if(front == maxSize){
front = 0;
}
currentSize--;
return temp;
top--;
return stackArray[top];
return queueArray[front];
count++;
queue.insert(input.charAt(j));
queue.Stackpush(input.charAt(j));
boolean isPalindrome=true;
while (!queue.isQueueEmpty()) {
if (queue.remove() == queue.Stackpop()) {
continue;
} else {
isPalindrome=false;
break;
if (!isPalindrome) {
System.out.println("Not a Palindrome");
} else {
System.out.println("Palindrome");