view - CIS 121 Spring 2010 First Midterm Review given out...

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

View Full Document Right Arrow Icon
CIS 121 - Spring 2010 First Midterm Review – given out Friday, February 19 Our first midterm is scheduled for Wednesday, February 24, during the normal lecture period. Please come to the usual classroom, we shall try to fit everybody there. Please arrive a few minutes before 11AM to give us time for seating arrangements. We will have a review session on Monday February 22, during the normal lecture period. This review sheet contains a list of readings, some sums to memorize, a mock exam, and some additional review problems. These questions should give you an idea of the scope and style of the questions that you’ll see on the exam. Note that all the material in the lecture notes, in the homeworks, or in the labs may potentially appear on the exam, even if it is not reviewed in the problems included here. The textbook is useful, and you should read the sections that have been recommended. We will post and distribute on Monday, February 22, solutions to these review problems. We strongly suggest that you attempt to solve them on your own before you see the solutions. 1 Readings Lecture notes 1–7 and from lecture notes 8 slides 1-26. Solutions to homeworks 1-4. Lab notes up to and including February 15-16. Recommended readings from textbook: Chapters 5, 7, 15, 16, 17, 18 and Sections 3.7, 4.8, 6.2-6.6, 6.8, 6.9, 19.1, 19.3, 21.1, 21.2, 21.5 2 Memorize! 1 + q + q 2 . . . q n - 1 = q n - 1 q - 1 ( q 6 = 1) 1 + 2 + . . . + n = n ( n + 1) 2 1 2 + 2 2 + . . . + n 2 = n ( n + 1)(2 n + 1) 6 3 Mock Exam (50 minutes for 100 points) 1. (30 pts) For each statement below, decide whether it is true or false. In each case attach a very brief explanation of your answer. 1
Image of page 1

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

View Full Document Right Arrow Icon
(a) Suppose that the worst-case running time of method qq is Θ( n log n ) and the worst case running time of method uu is Θ( n 2 ). Then there is no input for which uu runs faster than qq , true or false? (b) There is no complete binary tree with 17 nodes, true or false? (c) It is possible to reverse the content of a stack using at most three other auxilliary stacks, true or false? (d) A priority queue is a queue in which elements are enqueued in order of their priority, true or false? (e) Suppose we decide to change our model of computation (step-counting) by counting instructions that involve the creation of an array new int[n] as taking 10 n steps. In this new model, a program can have a different asymptotic complexity than in the original model, true or false? (f) Suppose that f ( n ) is a function defined only for integers n 1 and that f ( n ) is O (1). Then, there exists a constant c 0 such that f ( n ) c 0 for all n 1, true or false? 2. (15 points) Prove that n 2 +3 n n is O ( n n ). You cannot use any of the theorems stated in the lecture notes, the textbook, or the lab notes. Your proof should rely only on the definition of Big-Oh. 3. (15 points) Provide counterexamples for each of the following two false statements. You only need to give the counterexample, you don’t need to prove that it works. (As usual in this kind of problem, f ( n ) and g ( n ) map nonnegative reals to strictly positive reals.) (a) There is no f ( n ) such that f ( n ) is O (log n ) and f ( n ) is Ω(log n 2 ).
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