CISC220 F2023 Lab6

From class_wiki
Jump to: navigation, search

The Drozdek references below are to the textbook. It shouldn't matter whether you have the 3rd or 4th edition.

The exercises don't make it clear, but "computational complexity" means "big O complexity". Please write your f function (number of instructions, counting assignments, array accesses, arithmetic operations, and comparisons) as well as your g function.

1. Written problems

  • (0.75 points) Drozdek exercise 2.11.7 about changing the longest subarray algorithm. Please explain your reasoning.
    • Note: There is a typo in the modified outer loop code. "n==i" should read "n - i"
  • (0.75 points) Drozdek exercise 2.11.8 about the kth smallest integer
  • (1.5 points) Drozdek exercise 2.11.9 (0.5 points for each of adding, multiplying, and transposing)
  • (2 points) Drozdek exercise 2.11.10 with four loops (0.5 points per loop). Show the steps of your calculations.

2. Submission

  • Make a PDF file <Your Name>_Lab6_README.pdf with your answers to the written exercises
  • No need to compress or archive the PDF, since that's all you're turning in.
  • Submit it in Canvas by the time class starts on Thursday, October 12