subject

Write a class named palindrome. java and write a method ispalindrome that takes an intqueue as a parameter and that returns whether or not the numbers in the queue represent a palindrome (true if they do, false otherwise). a sequence of numbers is considered a palindrome if it is the same in reverse order. for example, suppose a queue called q stores this sequence of values:
front [3, 8, 17, 9, 17, 8, 3] back
then the following call:
ispalindrome(q) should return true because this sequence is the same in reverse order. if the list had instead stored these values:
front [3, 8, 17, 9, 4, 17, 8, 3] back
the call on ispalindrome would instead return false because this sequence is not the same in reverse order (the 9 and 4 in the middle don't match).
the empty queue should be considered a palindrome. you may not make any assumptions about how many elements are in the queue and your method must restore the queue so that it stores the same sequence of values after the call as it did before. the method header is specified as follows:
public static boolean ispalindrome(intqueue q)
public class intqueue{
integer[] arr;
int numofelements=0;
int front=0;
int rear=-1;
public intqueue(int cap);
public void enqueue(integer data);
public integer dequeue();
public boolean isfull();
public boolean isempty();
}
methods document:
public class intstack{
integer[] arr;
int index=0;
public intstack(int cap);
public void push(integer data);
public integer pop();
public integer top();
public boolean isfull();
public boolean isempty();
}
are the available methods, and we do not have size() or length() which is how i have done these types of problems before.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:00
Digital information is stored using a series of ones and zeros. computers are digital machines because they can only read information as on or off –1 or 0. this method of computation is known as the system
Answers: 1
question
Computers and Technology, 22.06.2019 08:10
Technician a says that if a valve is open when a piston rises to the very top of a cylinder, the piston may actually strike the valve head and cause serious engine damage. technician b says if the camshaft is located in the engine block, then the engine is called an overhead valve engine, ohv engine, or an in-block camshaft. who is right? a. b only b. both a and b c. a only d. neither a nor b
Answers: 3
question
Computers and Technology, 23.06.2019 00:20
The open systems interconnection (osi) reference model: defines standards for many aspects of computing and communications within a network. is a generic description for how computers use multiple layers of protocol rules to communicate across a network. defines standards for wireless local area network (wlan) communication protocols. details the advantages and disadvantages of various basic network cabling options.
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
You need a quick answer from a coworker. the most effective way to reach your coworker is through a. cloud server b. instant message c. teleconference d. telepresence
Answers: 1
You know the right answer?
Write a class named palindrome. java and write a method ispalindrome that takes an intqueue as a par...
Questions
question
English, 16.09.2020 19:01
question
Mathematics, 16.09.2020 19:01
question
Mathematics, 16.09.2020 19:01
question
Mathematics, 16.09.2020 19:01
question
Mathematics, 16.09.2020 19:01
question
Mathematics, 16.09.2020 19:01
question
Mathematics, 16.09.2020 19:01
question
Mathematics, 16.09.2020 19:01
question
Mathematics, 16.09.2020 19:01
question
Mathematics, 16.09.2020 19:01
question
Mathematics, 16.09.2020 19:01
question
Mathematics, 16.09.2020 19:01
question
Geography, 16.09.2020 19:01
question
Mathematics, 16.09.2020 19:01
question
Mathematics, 16.09.2020 19:01
question
Mathematics, 16.09.2020 19:01
question
Mathematics, 16.09.2020 19:01
question
Mathematics, 16.09.2020 19:01
question
Mathematics, 16.09.2020 19:01
question
Mathematics, 16.09.2020 19:01
Questions on the website: 13722361