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
What kind of operating system is MS-DOS?
ELEN [110]

MS-DOS is a command-line operating system.

Therefore, the best answer is Command-line.

8 0
3 years ago
Read 2 more answers
What are some differences between CUI and GUI ?
ollegr [7]

Answer:

Even though both are interfaces and serve its purpose of attempting to run the strategies, their components as well as the manipulate they will get from the patient differ.

Explanation:

CUI (Character User Interface) :-

  • It's a sort of user interface that only uses binary data and pseudographics for interface-output and data sessions.
  • That's characterized by low availability for operating systems I / O resources (act with integrity) and high speed with a display of data.

GUI (Graphical User Interface (GUI):-

  • Using graphical elements such as windows, icons, menus helps the user to communicate with the program.
  • It is a kind of user interface along which people interact with electronic equipment through characterizations of visual indicators.
3 0
3 years ago
How can I identify what is and what isn't an IP Address?
adelina 88 [10]

Answer:

you can identify an ip address in the bar where u type links

Explanation:

7 0
3 years ago
The engine flywheel bolts to the Rotor Pistons Front axle Crankshaft
swat32
The answer is D. Crankshaft.  The flywheel is connected to the crankshaft. The crankshaft<span> is </span>connected<span> to the pistons and moves in a circular motion to move the engine. Spark Plugs are based at the top of the pistons, this is used to ignite fuel in the pistons that move them. The timing belt is </span>connected to the crankshaft<span> and it rotates the camshaft. </span>
5 0
3 years ago
Why backup system of data and software is necessary. ​
zavuch27 [327]

Answer:

The purpose of the backup is to create a copy of data that can be recovered in the event of a primary data failure. Primary data failures can be the result of hardware or software failure, data corruption, or a human-caused event, such as a malicious attack (virus or malware), or accidental deletion of data.

7 0
3 years ago
Other questions:
  • What is a data mining??
    5·1 answer
  • The _____ establishes that the destination device is present on the network, verifies active service, and informs the destinatio
    13·1 answer
  • How would a designer interpret the word denier?
    12·2 answers
  • Where Can you find 2tickets Universal Studios Horror night
    10·2 answers
  • Similarities between inline css and internal css​
    6·1 answer
  • Algorithm of how to calculate the area of a square.
    12·2 answers
  • Write a recursive method called lengthOfLongestSubsequence(a, b) that calculates the length of the longest common subsequence (l
    15·1 answer
  • List out the storage measurements units of a computer .<br><br>​
    10·2 answers
  • The code to perform a binary search is below. Match the variable name with what it holds.
    12·1 answer
  • !!! PLEASE HELP ASAP REALLY NEED IT !!!
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!