Compsci 6, Fall 2011, Classwork 21

PRINT Names and NetID of students in group (min 2, max 3)
Name: __________________________   NetID: _____________

Name: __________________________   NetID: _____________

Name: __________________________   NetID: _____________

Problem 1

Compare the three linear_search algorithms. Will these all run about the same time? Explain.

Problem 2

Consider the list of numbers below. Circle the values that are compared when searching for 18 using a binary search. 3 7 8 10 13 18 21 22 25 34 37 42 44 46 49

Problem 3

Consider the list of numbers below. Circle the values that are compared when searching for 55 using a binary search. 3 7 8 10 13 18 21 22 25 34 37 42 44 46 49

Problem 4

Consider the list of numbers below. Show the list of numbers after each pass in Selection sort (a pass is selecting the smallest and swapping) 9 11 4 17 7 3 5