Question: Implement the following functions using recursion in the file recursion.py . Please check test _ recursion.py to understand the expected behavior of each function. There

Implement the following functions using recursion in the file recursion.py. Please check
test_recursion.py to understand the expected behavior of each function. There are no marks for
non-recursive implementations or functions that rely on sorting.
a. is_balanced(binary_number)(10 marks)
This function should return True if the input string of 0s and 1s contains the same
number of 0s and 1s and False otherwise.
b. reorder(numbers)(10 marks)
This function should reorder the given list of 0s and 1s into a new list so that all 0s
come before all 1s. The function must not change the given argument (numbers).

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!