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

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

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

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

View Full Document
Fall 2007, CS 111 Test #4 Page 2 of 6 ] [12 ] Pig [13 ] Quail [14 ] Rat [15 ] Tick What is the
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 04/29/2008 for the course HIST 202 taught by Professor Buller during the Spring '08 term at Virginia Military Institute.

### 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
Ask a homework question - tutors are online