1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Maksim231197 [3]
2 years ago
15

palindrome is a string that reads the same forwards as backwards. Using only a xed number of stacks, and a xed number of int and

char variables, write an algorithm to determine if a string is a palindrome. Assume that the string is read from standard input one character at a time. The algorithm should output true or false as appropriate
Computers and Technology
1 answer:
bixtya [17]2 years ago
6 0

Solution :

check_palindrome$(string)$

   lower_$case$_string$=$ string$. to$_lower()

   Let stack = new Stack()

   Let queue = new Queue();

   for each character c in lower_case_string:

       stack.push(c);

       queue.enqueue(c);

   let isPalindrome = true;

   while queue is not empty {

       if (queue.remove().equals(stack.pop())) {

           continue;

       } else {

           isPalindrome=false;

           break while loop;

       }

   }

   return isPalindrome

Input = aabb

output = true

input =abcd

output = false

You might be interested in
Choose the missing term.
qaws [65]

Answer:

import

Explanation:

the <em>import </em>keyword is used to import external modules into a python script.

6 0
2 years ago
A quick boot allows you to do what?
WITCHER [35]
Access the BIOS setup
6 0
2 years ago
Read 2 more answers
A file with a com extension is most likely to be a(n) ___ file.
olasank [31]
I think that the answer is: A executable
4 0
3 years ago
Read 2 more answers
Jack has a fear of getting up in front of a group of people and giving a presentation. When he gave his last presentation, he ta
dezoksy [38]

Answer:

Jack has to be very calm and try his best to present himself in an outward way and think about the fact that by the end of the night no one will remember that he messed up, I feel like he'll be okay :)

7 0
2 years ago
Read 2 more answers
Jake was working on an essay for his English class on a stormy Sunday afternoon. Before he could save his document, a big strike
matrenka [14]

Maybe in atosave, Computers mostly save what your working on :3

8 0
3 years ago
Other questions:
  • Which of the following are the rows or columns of white space created between grids?
    7·1 answer
  • What three steps Name a group??
    14·1 answer
  • How to Save Power-Point presentation as a single file Web page that can be uploaded to the World Wide Web ?
    14·1 answer
  • Which of the following are examples of how a company might use consumer data it had collected? a To decide what types of product
    10·1 answer
  • A selected graphic appears surrounded by a(n) ______, which has small squares and circles around its edges.
    7·1 answer
  • What are attribute grammars used for?
    8·1 answer
  • The operating system (OS) of an information system contains the software that executes the critical functions of the information
    6·1 answer
  • Why is dark supereffective against ghost?
    5·2 answers
  • Why does the peot use a simular pharase at the beggining of each stanza
    8·1 answer
  • In which of the following situations would it be most appropriate to choose lossy compression over lossless compression?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!