Question
CHOOSE ONE OF QUESTION 4B (Basic) or 4X (Complex); Palindrome is a simpler function to implement than Counting Sort. Q-4B:Write a program that reverses characters
CHOOSE ONE OF QUESTION 4B (Basic) or 4X (Complex); Palindrome is a simpler function to implement than Counting Sort.
Q-4B:Write a program that reverses characters found inside a set of parentheses and removes the parentheses characters:20 points
reverse_parentheses(test) = test
reverse_parentheses((test) = tset
reverse_parentheses(left(test)right = lefttsetright
reverse_parentheses(left((test))right = lefttestright
reverse_parentheses(first(second(third))fourth) = firstthirddnocesfourth
reverse_parentheses(((not_reversed)) = not_reversed
Assume parenthesis will always be balanced. Paste completed programs here.Use only standard libraries and data structures.
Q-4X:Implement the counting sort algorithm, write complete programs to solve the following datasets inAscendingorder. You need to paste your complete programs here.20 points
Use only standard libraries and data structures.
- A [7, 7, 3, 6, 3, 10, 1, 5, 7, 20]
- A [7, 7, 3, 6, 3, 10, 1, 5, 7, 4400]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started