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
What can help narrow your search results when using the Index search feature in the Help menu?
zlopas [31]
A by typing a keyword. This will narrow down your search results cause the computer knows what it is looking for.
7 0
3 years ago
Aaron has elaborate systems set up on his computer to remind him of all the things he has to do and when he has to do them. The
Scrat [10]

Answer:

Prospective memory

Explanation:

The main aim of Prospective  it includes recalling to perform  a planned action at  some specific point in time. Prospective memory includes the intention to perform a physical action and is linked to forward-looking behaviors.

Aaron has elaborated the set up of the system and the computer it reminds the things.The prospective  memory used in the  computer to carry out these things

8 0
4 years ago
The user can set their own computer hostname and username. Which stage of the hardware lifecycle does this scenario belong to?
11111nata11111 [884]

Answer:

Deployment

Explanation:

Hardware lifecycle management is geared at making optimum use of the computer hardware so as to maximize all the possible benefits. During the deployment stage of the hardware lifecycle, the user is prompted by the computer to input their own computer hostname and username. In doing this, it is important that the user takes note of possible flaws in security. Passwords are set at this stage too. The four stages in the hardware lifecycle are procurement, deployment, maintenance, and retirement. At the deployment stage, the hardware is set up and allocated to employees so that they can discharge their duties effectively.

So, for organizations, it is important that strong passwords are used to prevent security breaches in the event that an employee leaves the organization.

8 0
3 years ago
In a Python dictionary, an association is formed between what two components of the dictionary?
babunello [35]

Answer:

Yes, an association is formed between key and its value.

Explanation:

A dictionary in python is an unordered data structure where 2 elements are entered for each entry - a key and its value. Unlike list, we have to give the index through which we want to access that value. This is more flexible than lists as in lists index can be of int type only but in dictionary key can be of any datatype. For example :

dict = { "apple: 1 , "banana" : 2 }

Every element need not be of same type, they can differ too.

5 0
3 years ago
All of the following are ways to save money on transportation except :
Lisa [10]
The options listed are not related to the question. and if they were related in any sense then I would say the cheapest thing on the list is a phone card so I guess you can buy that and save the most for your travel as you can use phone cards anywhere as they have 1800 numbers which are free from any public phone. 
7 0
3 years ago
Other questions:
  • A ______________ deals with the potential for weaknesses within the existing infrastructure to be exploited.
    10·2 answers
  • A(n) ____ database is an application appropriate for an object-oriented database that contains text links to other types of docu
    7·1 answer
  • Group technology identifies components by a coding scheme that specifies the
    13·1 answer
  • Complete this code in main to perform the requested operations for a date entered by the user in this format: month dd, yyyy
    10·1 answer
  • Sales management wants a small subset of users with different profiles and roles to be able to view all data for compliance purp
    7·1 answer
  • Which function can you perform on a word processor but not on a typewriter?
    11·1 answer
  • Use the drop-down menus
    9·2 answers
  • 21. If you want to improve the performance of your PC, you need to upgrade the
    7·1 answer
  • Select the correct text in the passage.
    12·1 answer
  • Explain employment opportunities in the networking field 
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!