Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Questions 1 - 2 are based on the following information: A newspaper route has re

ID: 3833115 • Letter: Q

Question

Questions 1 - 2 are based on the following information: A newspaper route has recently been computerized. Information about each of the 100 customers is stored in individual objects first name, last name, payment due. In writing a computer program to process the customer objects, the programmer is uncertain whether to add a method to sort the objects. If the objects are not sorted, what is the maximum possible number of comparisons that must be made to obtain a particular customer's object using a sequential search? a) 100 b) 50 c) 7 d) 5 e) 3 If the objects are first sorted, what will be the maximum number of comparisons needed with a binary search to find a particular customer's object? a) 100 b) 50 c) 7 d) 4 e) 2 Of the following data structures, which would be best suited for an application where search time be minimized and where data can be easily added? a) linear linked list b) circular linked list with two header nodes c) hash table d) sequential file e) sorted array Arrange algorithms (logarithmic, quadratic, linear, constant) in order of decreasing efficiency. a) linear, constant, quadratic, logarithmic b) constant, logarithmic, linear, quadratic c) quadratic, constant, logarithmic, linear d) quadratic, linear, logarithmic, constant

Explanation / Answer

1.

There might be need to search through all customers to find last customer.

So max comparison would be a) 100

2.

If objects are sorted. then binary search takes max O(logn) comparison

which is close to c) 7 comparison

3. a) linked list will best fit if we are using linear search

4. Most efficient is constant, then logarithmic, then linear then qudratic

so obtion b)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote