Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CSC 517: Algorithms Midterm Exam October 2006 - Prof. B. Rosenberg, Exams of Computer Science

A midterm exam for the algorithms course (csc 517) held on october 9, 2006. The exam consists of five problems, each worth five points for a total of 25 points. Students are required to show all their work for partial credit and are not allowed to use notes or collaborate. The problems include ordering functions by big-oh, proving the correctness of a sum calculation loop, analyzing the build-max-heap algorithm, and finding an efficient algorithm to check for unique values in an array.

Typology: Exams

Pre 2010

Uploaded on 08/30/2009

koofers-user-yah-1
koofers-user-yah-1 🇺🇸

10 documents

1 / 7

Toggle sidebar

Related documents


Partial preview of the text

Download CSC 517: Algorithms Midterm Exam October 2006 - Prof. B. Rosenberg and more Exams Computer Science in PDF only on Docsity! Burton Rosenberg CSC 517: Algorithms 1 Midterm October 9, 2006. 11:15–12:05 PM There are five problems each worth five points for a total of 25 points. Show all your work, partial credit will be awarded. Space is provided on the test for your work; if you use a blue book for additional workspace, sign it and return it with the test. No notes, no collaboration. Name: Problem Credit 1 2 3 4 5 Total CSC 517: Algorithms 4 3. Show the result of Build-Max-Heap when run on the following array. (Show several intermediate steps.) 13 16 14 15 1 8 7 3 9 10 CSC 517: Algorithms 5 4. Consider the following algorithm to see if all the values in an array are unique, for i = 1 to length(A) for j = 1 to length(A) if ( i!=j ) if A[i] == A[j] return false end for end for return true Give the run time of this algorithm, in terms of n = length(A). Justify your answer. Find another algorithm to accomplish the task of finding if all values in an array are unique, which is significantly faster than the algorithm presented above. CSC 517: Algorithms 6 5. When you are one year old, one candle is lit for your birthday. When you are two years old, two candles are lit. When three, three candles, and so forth. By your 80-th birthday, what is the total number of candles lit for all your birthdays combined, including the 80 candles for this birthday.
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved