COMP151 - Homework 4 - Chapter 6
Click here to get the assignment
Assignment
Complete the following problems from the text. Pay attention to specific directions below as some differ slightly from what’s in the book. *Answers to non-coding problems should be placed inside the triple-quote blocks in ch6.py
. Code will also go in that file. Where to put which answers should be clear labels in the python file.
Problems
- R-6.1 No Coding
- R-6.2 No Coding
- R-6.3 A stub has been provided. You must also write some testing code
- R-6.4 A stub has been provided. You must also write some testing code. Be certain that you implementation is recursive! No loops. None.
- R-6.7 No Coding
- R-6.8 No Coding
- R-6-12 No Coding
- C-6.18 Actually implement the function. A stub has been provided. You must also write some testing code.
- C-6.27 *Actually implement the function. A stub has been provided. You must also write some testing code.
- C-6.21 Actually implement the function. A stub has been provided. The function is given a list and should return a list of all the subsets (i.e. a list of lists!).
A Note on Testing
When testing these function, you are allowed to access and inspect the internal array. You should not, however, utilize the internal array, or any internal variables, when solving the problems. Use only the Stack/Queue interface methods.