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
Based on your research and understanding, write a 3- to 4-page Microsoft Word document that:
Over [174]

Answer:

....

Explanation:

3 0
3 years ago
PLEASE HELP ANSWER THIS only if you know BOTH ANSWERS!
Leya [2.2K]

Answer:

For the first question I think it is chains

The second question.

The woman is suspicious at hotel doors have numbers so how could he have been confused

Explanation:

8 0
3 years ago
Read 2 more answers
im running out of gb on my phone, I have a lot of pics saved there and they're taking a lot of space, is there a way to back up
Varvara68 [4.7K]

Answer:

Google Drive

Explanation:

You should be able to download Google Drive, upload the pictures on there and delete them from your gallery. Then you can view them anytime you want.

3 0
3 years ago
1 : What format would you apply to give an entry the appearance of 12-Mar-2014
Arturiano [62]

Answer:

1. Date 2. It will appear to the right of the selected column.

4 0
3 years ago
Instant messaging is commonly referred to as
melomori [17]
Chat, IM, in real-time
7 0
3 years ago
Other questions:
  • Adam discovers a virus on his system that is using encryption to modify itself. the virus escapes detection by signature-based a
    14·1 answer
  • When talking about the physical elements of the internet, the term redundancy refers to:?
    13·1 answer
  • How do you add a PDF assignment to google docs and be able to edit it?
    13·1 answer
  • Magbigay ng ibang produkto na ginagamitan ng kasanayan ng basic sketching shading at outlining ​
    12·1 answer
  • Global address list characteristics
    11·1 answer
  • Which web browser was created by Google?
    5·2 answers
  • Which of the following is not a key component of a structure?
    12·1 answer
  • PLEASE HELP I HAVE A TEST RIGHT NOW!!!
    13·1 answer
  • Help me please with this
    12·1 answer
  • After creating a webpage with html code, what do you need to do so that others can access it on the internet?.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!