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
Different between ocular and compound miscroscope
Nuetrik [128]
<span>One system of lens - ocular microscope
Two systems of lens - compound microscope

Some of the parts of a compound microscope are the </span>eyepiece lens.<span> There are two knobs on under the other to one side of the microscope which are used for </span>Coarse focus and Fine focus. There is an illuminator<span> at the bottom of the microscopic stand, which sheds a powerful light on the subject under the lens. Other parts include </span>objective lenses<span>, </span>stage with stage clips<span> (where the subject is placed) and r</span>evolving nosepiece. The tube<span> connects the eyepiece lens to the </span>turret<span>.</span>
3 0
3 years ago
Help fast plzzzzzzzzzzzz ​
eimsori [14]

Answer:

Which question would you like help with?

4 0
3 years ago
Read 2 more answers
Define computer architecture?
tia_tia [17]

Answer:

computer architecture is a set of rules and methods that describe the functionality, organization, and implementation of computer systems. The architecture of a system refers to its structure in terms of separately specified components of that system and their interrelationships.

4 0
2 years ago
Your worksheet has the value 27 in cell B3. What value is<br>returned by the function =MOD(B3,6)?​
Digiron [165]

Answer:

3

Explanation:

MOD means the remainder after a division calculation.

\frac{27}{6}= 4r3

The remainder is 3

5 0
3 years ago
Technician A says that wheel speed sensors are a highly probable cause of illuminated EBC warning lamps. Technician B says that
Blababa [14]

Technician A because

3 0
2 years ago
Other questions:
  • Can a computer evaluate an expression to something between true and false? Can you write an expression to deal with a "maybe" an
    13·2 answers
  • Which translator program reads small portions of a program at a time, translating them into machine instructions which are then
    12·1 answer
  • To become a news anchor, you should get a Bachelor's degree in:
    11·2 answers
  • While visiting a web site during your lunch break, you see a window that states the web site will not operate properly without f
    13·1 answer
  • The process of saving files to disk is called.<br> A.read<br> B. Write<br> C. Lock<br> D. Protect
    6·1 answer
  • Effective presentations vary the color scheme on each slide.
    7·2 answers
  • How do you delete answers on Brain.ly?
    11·2 answers
  • The NVCC college professor receives frequent emails disguised as official business emails. They may be requests to reset a passw
    10·2 answers
  • Political parties to address the interest of civil society<br>​
    7·1 answer
  • I only put one answer and didn’t specify what it answered
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!