Computer Science 61B - Fall 1996 - Canny - Midterm 2

Computer Science 61B - Fall 1996 - Canny - Midterm 2 - CS...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 61B, Midterm 2, Fall 1996 UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Science Computer Science Division CS61B Fall 96 J.Canny CS 61B: Midterm Exam II This is an open-book exam worth 100 points. There are SEVEN questions and TWELVE pages in the booklet. Write all your answers in this booklet. You have 120 minutes, but to be sure to finish on time, we suggest you budget N minutes for an N-point question. Do not let yourself get stuck on one question. Make sure you start every one. The easiest points are at the beginning of the questions. Wait for permission to start before opening the booklet. Good Luck! Very important: Fill in this information now! Your name: _____________________________ Login: _________________ Section number: ____________________ Lab TA: _____________ For grading purposes only. ________________________________ |Problem # | Possible | Score | |__________|__________|________| |1 | 10 | | |__________|__________|________| |2 | 15 | | |__________|__________|________| |3 | 25 | | |__________|__________|________| |4 | 10 | | |__________|__________|________| |5 | 5 | | |__________|__________|________| |6 | 15 | | |__________|__________|________| |7 | 20 | | file:///C|/Documents%20and%20Settings/Jason%20Raft...0-%20Fall%201996%20-%20Canny%20-%20Midterm%202.htm (1 of 8)1/27/2007 6:31:32 PM CS 61B, Midterm 2, Fall 1996 |__________|__________|________| |Total | 100 | | |__________|__________|________| 1. (10 points) The three below is a binary search tree (but not an AVL tree). Show the result of doing Insert (20), followed by Delete(50). 50 ______/ \______ / \ 19 80 _/ \_ _/ \_ / \ / \ 8 27 73 95 / / / \ / 4 22 60 79 88 \ 24 Draw the tree after Insert(20) here: Draw it after Delete(50) here: 2. (15 points) The following are the contents of an array A, going left-to-right from A[0] to A[12]: A = {98, 60, 20, 45, 3, 16, 18, 23, 17, 1, 2, 8, 9} This array represents a heap under the usual arrangement. Draw the heap as a binary tree below. file:///C|/Documents%20and%20Settings/Jason%20Raft...0-%20Fall%201996%20-%20Canny%20-%20Midterm%202.htm (2 of 8)1/27/2007 6:31:32 PM CS 61B, Midterm 2, Fall 1996 Now draw the heap after an insert(35) operation: Now draw the heap after a Getmax() operation: 3. (25 points) (Please read parts (a)-(f) of this question carefully and answer all of them) Its your first week working at "Don Corleons's Data Structures with Class". An important customer needs a reliable implementation of stacks and queues. You are eager to please in your first assignment, and also aware that two other employees who got behind deadline have mysteriously disappeared recently....
View Full Document

Page1 / 8

Computer Science 61B - Fall 1996 - Canny - Midterm 2 - CS...

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

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