CSpartB-Aug09Sol - Computer Science Foundation Exam Computer Science Section 1B Name PID Q1 Q2 Q3 Q4 Q5 Total Max Pts 10 10 10 10 10 50 Type ANL

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Computer Science Foundation Exam August 14, 2009 Computer Science Section 1B Name: PID: Max Pts Type Passing Threshold Student Score Q1 10 ANL 7 Q2 10 DSN 7 Q3 10 DSN 7 Q4 10 ANL 7 Q5 10 ANL 7 Total 50 35 You must do all 5 problems in this section of the exam. Partial credit cannot be given unless all work is shown and is readable. Be complete, yet concise, and above all be neat . Do your rough work on the last page.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
1) (10 points) Order Notation Assume that the operations below are implemented as efficiently as possible. Using Big-O notation, indicate the time complexity in terms of the appropriate variables for each of the following operations: a) Popping every element off a stack containing n elements ___________ b) Adding m elements to a queue that already contains n elements ___________ c) Computing the arithmetic mean (average) of an array containing ___________ n integers d) Determining the median in a sorted array containing n integers ___________ e) Sorting n integers using Mergesort ( best case ) ___________ f) Inserting n integers into an initially empty AVL tree ( best case ) ___________ g) Inserting n integers into an initially empty AVL tree ( worst case ) ___________ h) Inserting n integers into an initially empty binary search tree that
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 09/21/2011.

Page1 / 6

CSpartB-Aug09Sol - Computer Science Foundation Exam Computer Science Section 1B Name PID Q1 Q2 Q3 Q4 Q5 Total Max Pts 10 10 10 10 10 50 Type ANL

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online