Question: a) A palindrome is a word, phrase, or sequence that reads the same backwards and forwards. Example: madam. Write a pseudocode that uses Queue data

 a) A palindrome is a word, phrase, or sequence that reads

a) A palindrome is a word, phrase, or sequence that reads the same backwards and forwards. Example: "madam". Write a pseudocode that uses Queue data structure to find whether a given string is a palindrome or not. b) It's a rainy evening and you visit a Montessori school filled with ' n ' kids. The instructor, Mrs. Tina wants to conduct a game and instructs all the kids to form a chain by holding their hands. The kids immediately hold each other's hands and form a chain (each kid has 1 kid to their left and one kid to their right except the first and last kids). Mrs. Tina then starts the game and instructs that she would shout out a number "i and in groups of "i", kids must reverse themselves. Example: [Amirtha, Mani, Sunaina, Ramesh. Nammi] are playing and the instructor shouts out 2. After this round, the kids are in the order. [Mani, Amirtho, Ramesh, Sunaina, Nammi]. Tina would never call out a negative number and she can call out any number less or equal to the positions. Write a pseudocode for this game using an appropriate data structure and mention your complexity using Big-Oh notation. [2+3=5M]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!