Assignment 13
Due Date Thurs 3/2 at 11:59pm
Possible Points 41
Purpose To use loopers to solve complex list-processing problems.
Graded Exercises
The use of lambda in these problems is optional, but the use of predefined loops when they are appropriate is not.
Exercise 1 Design a function that given a list of lists appends them all together.
Exercise 2 Design a function that given a list of list of numbers determines if they are pairwise disjoint or not (lists are pairwise disjoint if none of them share any elements).
Exercise 3 Design a function that takes a list of books (books have a title, author, and page count) and sorts them alphabetically by title.
Exercise 4 Design a function that given a natural number n outputs the identity matrix of size n. An identity matrix can be represented as a list of list of numbers where all elements of the inner lists are 0 except the ith element in the ith list, which is 1. Here is more information on the identity matrix.
Exercise 5 Design a function that given a list of numbers and a number n replaces all occurrences of 0 with two copies of n.