CS 111-T4 - Fall 2007, CS 111 Test #4 Page 1 of 5 CS 111...

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

View Full Document Right Arrow Icon
Fall 2007, CS 111 Test #4 Page 1 of 6 CS 111 – Introduction to Computer Science, Test #4 Calculators are NOT allowed at all in this test. You must show your work clearly. Help Received: _____________________ Name: _______________________ 1. (10 pts.) Show step-by-step comparisons in searching for “Duck” in the following sorted array using sequential search algorithm . How many comparisons did you make? [0] Ant [1] Bird [2] Cat [3] Cow [4] Deer [5] Dog [6] Fish [7] Goat [8] Horse [9] Lice [10 ] Mule [11 ] Panda [12 ] Pig [13 ] Quail [14 ] Rat [15 ] Tick What is the worst number of comparisons to search in an array of size n using this algorithm ? 2. (16 pts.) Show step-by-step comparisons in searching for “Monkey” in the following sorted array using binary search algorithm . How many comparisons did you make? [0] Ant [1] Bird [2] Cat [3] Cow [4] Deer [5] Dog [6] Fish [7] Goat [8] Horse [9] Lice [10 ] Mule [11 Panda
Background image of page 1

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

View Full DocumentRight Arrow Icon
Fall 2007, CS 111 Test #4 Page 2 of 6 ] [12 ] Pig [13 ] Quail [14 ] Rat [15 ] Tick What is the
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.

Page1 / 6

CS 111-T4 - Fall 2007, CS 111 Test #4 Page 1 of 5 CS 111...

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