Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For this assignment you are going to write code that solves problems using recursion. Note the emphasis: you must use recursion! If you're having problems
For this assignment you are going to write code that solves problems using recursion. Note the emphasis: you must use recursion!
If you're having problems starting a question, consider the simplest possible case ie a or a singlecharacter string, etc and using
induction, figure out how to get to the next case.
All questions in this assignment will be answered in the same Python file:
assignpy Read the description of each question below, and refer to
the
assignpy file comments for further clarification.
Pay close attention to the specifications and the submission requirements.
In the
assignpy file, you will modify the recursive function called permutations which is given on slide of Topic class notes refer to
that slide for further explanation The current code outputs the permutations as in the first version on slide You must modify the code so
that the output is in a more 'systematic' ordering, as in the second version on slide
Generating Strings
In the
assignpy file, implement the recursive function called generateReverseorder which generates all length strings of s and s
for a given nonnegative integer in order from largest to smallest aka descending order
Your function must have as the only parameter and must return a list containing all length strings of s and s in the correct order
Run the code to get an idea of what the expected output should look like.
Note: The test output examples are in descending order, since if you consider them as binary numbers, they start at and decrement each
time.
Analyzing a String
In the
assignpy file, implement the recursive function called countChars which analyzes the given string and returns a element list of
integers representing the number of consonants, vowels, and other characters respectively in that string.
Your function must have a string as the first parameter; you may add other parameters as necessary.
Sample output should be as follows:
"abc de Consonants, Vowels, Other:
To be or not to be Consonants, Vowels, Other:
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