oops...who can do this ???
CIS1000C
Searching & Sorting Lab
Note: To get credit, you must score 60 pts. or higher
|
Name: |
|
Given the following array of numbers:
|
6 |
8 |
10 |
25 |
50 |
65 |
70 |
86 |
a. Trace the Binary Search algorithm to find an item whose value is 70 20 pts.
|
first |
last |
middle |
comparison |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Return Value:
b. Trace the Binary Search algorithm to find an item whose value is 9 20 pts.
|
first |
last |
middle |
comparison |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Return Value:
Given the following array of numbers:
|
7 |
2 |
8 |
3 |
9 |
5 |
c. Sort the list using the Selection Sort Algorithm. Show each iteration using the following table:
30 pts.
|
firstUnsorted |
smallest |
indexOfSmallest |
List |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
d. Sort the list using the Bubble Sort Algorithm. Show each iteration using the following table:
30 pts.
|
firstUnsorted |
swap (T/F)? |
List after single swap |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|