q9 sol6 - CSCI.1100 Computer Science I Quiz 9 Monday,...

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

View Full Document Right Arrow Icon
Quiz 9 Monday, November 16, 2009 Closed book, closed notes, no computers or calculators of any kind. Name: RCS login: Circle your lab section: (01 MTh 10:00) (02 MTh 12:00) (03 MTh 2:00) (04 MTh 4:00) (05 MTh 6:00) (06 MTh 10:00) (07 TF 10:00) (08 TF 12:00) (09 MTh 12:00) (10 TF 2:00) (11 MTh 4:00) 1. Consider the following list of 12 int numbers stored in a one-dimensional array (12 points): 7 12 13 21 39 42 56 58 63 69 72 75 [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] Suppose that you use binary search to search this list. a) The binary search algorithm looks for a number by repeatedly examining the value of the number in the middle of the current search interval. Show the sequence of list values examined by binary search as it searches for 63 in this list. 42 63 1 point for each number b) The binary search algorithm looks for a number by repeatedly examining the value of the number in the middle of the current search interval. Show the sequence of list values examined by binary search as it searches for 7 in this list. 42 13 7
Background image of page 1

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

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

Page1 / 2

q9 sol6 - CSCI.1100 Computer Science I Quiz 9 Monday,...

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

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