Study Guide for Quiz 4

There will be a quiz on Wednesday (12 November 2008). The quiz will be on lists. Unlike the other quizzes, you will be asked to write code.

Here is a check list of operations that you should be familiar with lists:

  1. Create a 1-D and 2-D list
  2. Traverse a 1-D and 2-D list
  3. Sum and average all the elements in a 1-D and 2-D list
  4. Compare two lists (1-D and 2-D) and determine if they have exactly the same elements in the same order
  5. Determine if a 1-D list is sorted in ascending or descending order
  6. Determine if a 1-D list is a palindromic
  7. Find the maximum and minimum in a 2-D list of numbers
  8. Find the second highest number in 1-D and 2-D list
  9. Add element by element two lists (1-D and 2-D) and produce another list that has the sum
  10. Multiply element by element two (1-D) lists and add the product (scalar product)
  11. Add either a row or column in a 2-D list
  12. Add the diagonal elements in a 2-D square list
  13. Merge two sorted 1-D lists and produce a third list
  14. Given two 2-D lists representing two matrices perform a matrix multiplication

Here are some specific questions for the quiz. For each question write a piece of code and run it to make sure it works.