CSpartB-Aug09Sol - Computer Science Foundation Exam...

Info icon This 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.
Image of page 1

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

View Full Document Right 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 ___________
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern