A __________________ search looks through the search pool one element at a time. A. clever B. linear C. binary D. selection E. insertion
Question
A __________________ search looks through the search pool one element at a time. A. clever B. linear C. binary D. selection E. insertion
Solution
B. linear
Similar Questions
A _______________ search is more efficient than a linear search. A. bubble B. insertion C. none of the above D. selection E. binary
In a binary search, _______________________________ . A. it is assumed that all of the elements are integers. B. it is assumed that the search pool is large. C. it is assumed that the search pool is ordered. D. it is assumed that all of the elements are Strings. E. it is assumed that the search pool is small.
A compound computed search that combines a binary search to get close to the required record and then uses sequential search to find the item is referred to as a/an:Question 3Select one:a.Zipf searchb.An Exact match searchc.A Dictionary searchd.bit map vector search
Q. 3 (10 marks) Consider the following data structure for representing a set. The elements of the set are stored in a singly linked list of sorted arrays, where the number of elements in each array is a power of 2 and the sizes of all the arrays in the list are different. Each element in the set occurs in exactly one array. The arrays in the linked list are kept in order of increasing size. To perform SEARCH, perform binary search separately on each array in the list until either the desired element is found, or all arrays have been considered. To insert a new element x into the set (given the precondition that x is not already in the set), create a new array of size 1 containing * insert this new array at the beginning of the linked list while the linked list contains 2 arrays of the same size merge the 2 arrays into one (sorted) array of twice the size (a) Draw the data structure that results after inserting the following sequence of elements into an initially empty set: 2, 63, 1, 32, 77, 7 (b) What is the worst-case time, to within a constant factor, for performing SEARCH when the set has size n? Justify your answer. HINT: Using the following notation may help you express your answer: "Let I, denote the set of bit positions in the binary representation of n that contain the value 1.". (c) What is the worst-case time, to within a constant factor, for performing INSERT when the set has size ?? Justify your answer. (dd) Use the aggregate method to prove that the amortized insertion time in a sequence of n insertions, starting with an initially empty set, is ?(??g ?). (e) Use the accounting method to prove that the amortized insertion time in a sequence of ? insertions, starting with an initially empty set, is ?(??g ?) Q. 4 (5 marks) Suppose you want to find connected components using disjoint sets on undirected graph G = (V, E). where V = (2, 2, 2, 2, 2, 2, 2, 2, 2, ?, ?) and the edges in the E are processed in the order List the vertices in each connected component after each iteration of find-set and union. Show all the steps. Q. 5 (15 marks) Disprove following claim with an example: The height of ? node Fibonacci heap is always ?(??g ?) . Use following argument to disprove the claim. a) [10 points] Show that for any positive number of nodes ?, a sequence of Fibonacci heap operations that create a Fibonacci heap that consists of one tree that is a linear chain of ? nodes.
Sequential searching
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.