Please create a set containing the first 12 characters of your name (without space). If your name contains less than 12 characters, then repeat again from the beginning. For example: JOHNNY DEPP would become {‘J’,’O’,’H’,’N’,’N’,’Y’,’D’,’E’,’P’,’P’,’J’,’O’}. Now, answer the following questions. You can use C++ coding or simply a pseudo-code.
a. (5 points) Create a recursive function to print these 12 characters in reverse. Identify which is the base case and the general case.
b. (5 points) Use a stack to reverse these 12 characters.
c. (5 points) Use a queue to check if these 12 characters is a palindrome.
Please create a set containing the first 12 characters of your name (without space). If your name contains less than 12
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am