• 3

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 3 out of 3 pages.

Direction:Answer the following items (Malik & Nair, 2012).1. Mark the following statements as true or false.a. A linear search of a list assumes that the list is in ascending order.
b. A binary search of a list assumes that the list is sorted.
c. A binary search is faster on ordered lists and slower on unordered lists.
2. Consider the following list:63 45 32 98 46 57 28 100Using the linear search as described in this module, how many comparisons are required to findwhether the following items are in the list? (By comparison, we mean item comparisons)
b. 57 -SIX COMPARISONSc. 63 -ONE COMPARISON
3. Consider the following list:21017454955688592Using the detailed code for binary search as described in this module, how many comparisons arerequired to find whether the following items are in the list? Show the values of left, right and mid andthe number of comparisons after each iteration of the loop.a. 15981109811049
Number not in the listNo. of Iteration: 3b. 49Array = 210174549556885
End of preview. Want to read all 3 pages?

Course Hero member to access this document

Term
Summer
Professor
Aaron Lington
Tags
Harshad number, Green Line, linear search of a list, binary search of a list