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]
3 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]3 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
How do you use the Internet? Think about your typical day. When are you using the Internet? For what purposes? What role does it
Basile [38]

Answer:

I use the internet for a variety of activities. In a typical day, I'd use the internet to do the following:

  1. I check my email
  2. follow the latest trends and news on popular social media channels
  3. communicate with friends, family and clients via social media channels
  4. I research business topics
  5. I use it for my work as a management consultant

The internet is now a primary utility. I currently spend more on internet data subscription than on fuel, electricity, phone call credit, and even water. It now has a tremendous impact on my daily life.

Cheers

5 0
3 years ago
A tripod head can move vertically or horizontally. What term describes these movements?
AnnyKZ [126]

The term for vertical movement of a tripod is Tilt. The term for horizontal movement is Pan.

Vertical movement of the camera angle involves pointing the camera up and down. This sort of movement is achieved so as to follow a subject or show the top and bottom of a still object. With Tilt, you can show how tall objects are. On the other hand, the tripod’s horizontal movement is used for a smooth effect. Like Tilting, it shows a subject or show the distance from left to right between two objects. Pan shots are great for panoramic views .

7 0
4 years ago
Read 2 more answers
Portrait and Landscape are
ValentinkaMS [17]

Answer:

a page layout

Explanation:

6 0
3 years ago
What is the difference between requirements and controls in the security process? Give examples of each.
konstantin123 [22]

Answer:

Security controls are those measures taken to prevent, identify, counteract, and reduce security risks to computer systems, whereas, Security Requirements are guidelines or frameworks that stipulates measures to ensure security control.

Explanation:

Security controls encompass all the proactive measures taken to prevent a breach of the computer system by attackers. Security requirements are those security principles that need to be attained by a system before it can be certified as safe to use.

Security controls are of three types namely, management, operational, and technical controls. Examples of technical controls are firewalls and user authentication systems. A statement like 'The system shall apply load balancing', is a security requirement with an emphasis on availability.

4 0
3 years ago
As a photographer, what will be the driving force behind everything that you produce?
GREYUIT [131]

Answer:

You have to like it to be successful in photography.

Explanation:

8 0
3 years ago
Other questions:
  • What is the circular motion that the earth makes in its orbit around the sun
    14·1 answer
  • In Java please:Re-type the code and fix any errors. The code should convert non-positive numbers to 1. if (userNum > 0) Syste
    10·1 answer
  • I need help with getting a profile pic
    5·1 answer
  • Match the vocabulary word to the accurate definition. A software program that enables you to search for, interact with, and retr
    5·2 answers
  • Biosolids are used as a chemical free natural choice for fertilizing.
    5·1 answer
  • What is it called when a additional document is added to an email
    13·2 answers
  • Anyone wanna talk im 13 eboy single
    11·2 answers
  • How to execute python code in command prompt *window*?
    5·1 answer
  • Write a function isCString which accepts as arguments a const pointer to a char array and an integer for the size of the array
    12·1 answer
  • Passing an argument by ___ means that only a copy of the arguments value is passed into the parameter variable and not the addrt
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!