1. At most, how many comparisons are required to search a sorted vector of 255 e
ID: 3874075 • Letter: 1
Question
1. At most, how many comparisons are required to search a sorted vector of 255 elements using the binary search algorithm?
(a) 10 (b) 8 (c) 7 (d) 9
2. A list implementation of a graph might use an array of linked lists, each list containing all the ________ a vertex.
(a)paths containing (b) vertices adjacent to
edges adjacent to (c) trees containing
3. The adjacency list of the undirected graph
is on the form:
………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………..
(T/F) The linear search has asymptotic running time of order n
How many ways do you have to parenthesize the matrices multiplication A1A2A3A4? ………………
Question 2 ( 5 Marks):
Apply the BFS algorithm on the following undirected graph with source B.
Explanation / Answer
1)
we can calculate by the formula
T(n) = [log2(n)]
T (255) = [log2(255)]
= 7.9
= 8
ans will be 8
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.