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

Info icon This 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
Image of page 1

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

View Full Document Right Arrow Icon
Fall 2007, CS 111 Test #4 Page 2 of 6 ] [12 ] Pig [13 ] Quail [14 ] Rat [15 ] Tick What is the best number of comparisons to search in an array of size n using this algorithm ?
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