Difference between revisions of "CISC220 F2014 Lab5"
From class_wiki
(Created page with "==Lab #2== 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 "comp...") |
(→Lab #2) |
||
Line 3: | Line 3: | ||
The ''Drozdek'' references below are to the textbook. It shouldn't matter whether you have the 3rd or 4th edition. | 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 | + | 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=== | ===1. Written problems=== | ||
Line 10: | Line 10: | ||
** '''Note: There is a typo in the modified outer loop code. "n==i" should read "n - i" ''' | ** '''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 ''k''th smallest integer | * '''(0.75 points)''' Drozdek exercise 2.11.8 about the ''k''th 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=== | ===2. Submission=== |
Latest revision as of 13:22, 6 October 2021
Lab #2
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>_Lab5_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 Sakai by midnight at the end of Thursday, October 9