Difference between revisions of "More With Arrays Review Questions and Exercises"
From CompSciWiki
(→Application of the binary search) |
(→Application of the binary search) |
||
Line 12: | Line 12: | ||
==Exercises== | ==Exercises== | ||
===Application of the binary search=== | ===Application of the binary search=== | ||
− | Modify the [[Searching Arrays#binary search|binarySearch()]] algorithm to keep count of how many elements the algorithm checks before finding the desired element. Print out each checked element's value (in other words, the value compared with the search value. | + | Modify the [[Searching Arrays#binary search algorithm|binarySearch()]] algorithm to keep count of how many elements the algorithm checks before finding the desired element. Print out each checked element's value (in other words, the value compared with the search value. |
Revision as of 13:19, 30 November 2007
COMP 1010 Home > Selection Search Algorithm
{{{Body}}}
Review Questions
Passing Arrays using Methods
Working with Paritally Filled Arrays
Arrays of Strings
Searching Arrays
Sorting Arrays
Parallel Arrays
Exercises
Application of the binary search
Modify the binarySearch() algorithm to keep count of how many elements the algorithm checks before finding the desired element. Print out each checked element's value (in other words, the value compared with the search value.