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:40
1. the program must provide following functions to extract some statistics. note that the data_list parameter specified in these functions may be the same for all functions or different for different functions—that is your choice. a skeleton file is provided on mirmir. a) open_file()prompts the user to enter a year number for the data file. the program will check whether the year is between 1990 and 2015 (both inclusive). if year number is valid, the program will try to open data file with file name ‘year.txt’, where is the year. appropriate error message should be shown if the data file cannot be opened or if the year number is invalid. this function will loop until it receives proper input and successfully opens the file. it returns a file pointer and year. i. hint: use string concatenation to construct the file name b) read_file(fp)has one parameter, a file pointer read. this function returns a list of your choosing containing data you need for other parts of this project. c) find_average(data_list) takes a list of data (of some organization of your choosing) and returns the average salary. the function does not print anything. hints: i. this is not the average of the last column of data. it is not mathematically valid to find an average by finding the average of averages—for example, in this case there are many more in the lowest category than in the highest category. ii. how many wage earners are considered in finding the average (denominator)
Answers: 1
question
Computers and Technology, 22.06.2019 12:20
Usually, when we sniff packets, we are only interested certain types of packets. we can do that by setting filters in sniffing. scapy’s filter use the bpf (berkeley packet filter) syntax; you can find the bpf manual from the internet. set the following filters and demonstrate your sniffer program again (each filter should be set separately): (a) capture only the icmp packet. (b) capture any tcp packet that comes from a particular ip and with a destination port number 23. (c) capture packets comes from or to go to a particular subnet. you can pick any subnet, such as 128.230.0.0/16; you should not pick the subnet that your vm is attached to.
Answers: 3
question
Computers and Technology, 23.06.2019 00:30
Quic which one of the following is the most accurate definition of technology? a electronic tools that improve functionality b electronic tools that provide entertainment or practical value c any type of tool that serves a practical function d any type of tool that enhances communication
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
Cómo pongo un tomo de llamada sin pagar?
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
Social Studies, 26.01.2021 22:20
question
Mathematics, 26.01.2021 22:20
question
Mathematics, 26.01.2021 22:20
question
History, 26.01.2021 22:20
Questions on the website: 13722363