Question: 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 '1' or a single-character 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:
assign2.py. Read the description of each question below, and refer to
the
assign2.py file comments for further clarification.
Pay close attention to the specifications and the submission requirements.
In the
assign2.py file, you will modify the recursive function called permutations (), which is given on slide 17 of Topic 2 class notes (refer to
that slide for further explanation). The current code outputs the permutations as in the first version on slide 18. You must modify the code so
that the output is in a more 'systematic' ordering, as in the second version on slide 18.
Generating Strings 40%
In the
assign2.py file, implement the recursive function called generateReverseorder (), which generates all length-n strings of 0's and 1's,
for a given non-negative integer n, in order from largest to smallest (aka, descending order).
Your function must have n as the only parameter and must return a list containing all length-n strings of 0's and 1'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 2n-1 and decrement each
time.
Analyzing a String 40%
In the
assign2.py file, implement the recursive function called countChars (), which analyzes the given string and returns a 3-element list of
integers representing the number of consonants, vowels, and other characters (respectively) in that string.
Your function must have a string s as the first parameter; you may add other parameters as necessary.
Sample output should be as follows:
s= "abc de" Consonants, Vowels, Other: 3,2,1
s="To be or not to be" Consonants, Vowels, Other: 7,6,5
 For this assignment you are going to write code that solves

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!