Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 . Which of the following statements about Breadth - First Search ( BFS ) is NOT true? ( A . ) It takes time

1. Which of the following statements about Breadth-First Search (BFS) is NOT true?
(A.) It takes time O(n long n) to visit the site.
(B.) It can be used to test whether a graph is connected or not.
(C.) It can calculate the shortest path from the starting point to each vertex.
(D.) can calculate whether there are loops in the graph.
2. Which of the following descriptions of Depth-First Search (DFS) is NOT true?
(a.) It costs O(n+m) to visit the entire graph.
(b.) The spanning tree of a graph can be computed if the graph is connected.
(C.) Finding loops in a graph.
(d.) find the shortest path between two vertices.
3. Is the quick sort algorithm a stable algorithm, depending on whether the input data is sorted or randomized? What is the average complexity of the time required for sorting?
a. Unstable, with expectation O(n log n)
b. Unstable, O(n log n)
c. Stable, O(n^2)
d. Stable, O(n log n)
4. Consider a tree T storing n data items. If T is a binary search tree, what is the worst-case height of T?
(a.) n /2
(b.) n log n
(C) log n
(D) n
5.
Consider a tree T storing n data items. If T is a splay-tree, what is the worst-case height of T?
(a.) None of the following
(b.) n
(C.) log n
(d.) n log n

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions