CSD Unit 8

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

E

U08 - Q.005 - M Which graph representation is best? A/ Adjacency list B/ Adjacency matrix C/ Incidence matrix D/ None of the others E/ It depends on the problem

A B

(Choose 2 answers) U08 - Q.002 - M Which of the following statements about finding the shortest path are true: A/ For label-correcting method, information of any label can be changed during application of method. B/ The complexity of Dijkstra's algorithm is `O(|V|^2)` C / The complexity of Dijkstra's algorithm using heap is `O(|V|ln|V|)` D/Ford's algorithm relies on label-setting method. E/ The complexity of Ford's algorithm is `O(|V||E|)` for any graph.

A B

(Choose 2 answers) U08 - Q.004 - M Which of the following statements about graph coloring is true: A/ The complexity of sequential Coloring algorithm is `O(|V|^2)` B/ Sequential Coloring algorithm establishes the sequence of vertices and a sequence of color before coloring them. C/ In sequential coloring algorithm, vertices must be ordered according to indices already to the vertices. D/ In sequential coloring algorithm, vertices must be ordered according to degree of vertices

C D

(Choose 2 answers) U08 - Q.010 - M Selectionsort and quicksort both fall into the same category of sorting algorithms. What is this category? A/ O(n log n) sorts B/ Divide-and-conquer sorts C/ Interchange sorts D/ Worst time is quadratic

A

U08 - Q.001 - M Which of the following sentences are true: A/ The complexity of DFS is `O(|V| + |E|)` , where `|V|` is number of vertices and `|E|` is number of edges. B/ All algorithms are more efficient if the underlying graph traversal is not BFS but DFS. C/ To prevent loop from happen in an algorithm for traversing a graph, each visited vertex can be marked.

D

U08 - Q.003 - M Which of the following statement about spanning tree is false: A/ The complexity of Kruskal's algorithm depends on the complexity of the sorting method applied. B/ The complexity of Kruskal's algorithm depends on the method used for cycle detection. C/ All of the others. D/ None of the others

A

U08 - Q.006 - M Most of the label-setting and label-correcting methods are used to find from one vertex to all other vertices. A/ True B/ False

C

U08 - Q.007 - M When is insertionsort a good choice for sorting an array? A/Each component of the array requires a large amount of memory. B/ Each component of the array requires a small amount of memory C/The array's size is not large . D/ The processor speed is fast

A C

U08 - Q.008 - M Which algorithms have the complexity of O(n lgn) A/ Heap sort in the worst case. B/ Shell sort C/ Quick sort in the best case. D/ Bubble sort

C

U08 - Q.009 - M " What is number of comparisons in the worst case for mergesort to sort an array of n elements ? " A/ O( lg ` n ` ) B/ O ( ` n ` ) C/ O ( ` n `lg` n`) D/ O( `n^2` )

B

U08 - Q.011 - M Using adjacency matrix representation for a graph of n vertices and m edges, what is the expected number of operations needed to loop through the graph to find down adjacent list of a known vertex? A/ O(m) B/ O( n ) C/ O`(m^2)` D/ O`(n^2)`

A

U08 - Q.012 - M What graph traversal algorithm uses a queue to keep track of vertices which needs to be processed? A/ Breadth-first search. B/ Depth-first search.

D

U08 - Q.013 - M Suppose that you have a directed graph representing all the flights that an airline flies. What algorithm might be used to find the best sequence of connections from one city to another? A/ Breadth first search. B/ Depth first search. C/ A cycle-finding algorithm. D/ A shortest-path algorithm.

A

U08 - Q.014 - M The ..... algorithm can be used to schedule the final exams so that no student has two exams at the same time. A/ Graph coloring B/ Matching C/ Topological sort D/ Eulerian graph

B

U08 - Q.022 - M The depth-first search algorithm for a graph will _________ A/ search for the minimal edges needed to visit each vertex in the graph. B/ travel all possible paths from a vertex to see if it can find the destination before it moves on to the adjacent vertices. C/Checks all adjacent vertices before moving down the paths to find the destination. D/ None of the others.

C

U08 - Q.023 - M Select a correct statement. A/ Djikstra's shortest path algorithm can be applied to undirected graph. B/ The breadth-first search can be used to find the shortest path from a source vertex to the destination vertex in unweighted graph. C/ All of the others.

C

U08 - Q.024 - M Two algorithms, used for finding a minimum spanning tree, are Kruskal and Dijkstra. Which algorithm uses the cycle detection method? A/ The Kruskal algorithm. B/ The Dijkstra algorithm. C/ All of the others.

A

U08 - Q.025 - M Which of the following statements about the shortest path finding algorithm of Dijkstra is true? A/ It is label-setting algorithm. B/ It can be applied to graphs have negative weights. C/ It's complexity is O(|V|), where |V| is number of vertices of the graph. D/ All of the others.

C

U08 - Q015 Given a graph below. What is the output of breadth-first traversal from vertex C? ( visit nodes in ABC order if there are some nodes having the same selection ability ). A/ C, B, D, A, E, G, F, H B/ C, B, D, A, E, F, G C/ C, B, D, A, E, F, G, H D/ C, B, D, A, G, E, F, H

D

U08 - Q016 Given a graph below. What is the output of depth-first traversal from vertex B? (visit nodes in ABC order if there are some nodes having the same selection ability) A/ B, A, E, G, C, F, D B/ B, A, E, G, F, C, D, H C/ B, A, E, G, F, D, C, H D/ B, A, E, G, C, F, D, H

B

U08 - Q017 Given a weighted graph below and you are using the Dijkstra algorithm to find the shortest path from the vertex B to the vertex F. What are the correct order of vertices selected into the set S until the vertex F is selected? (Each step a vertex with minimal current distance is selected into S). A/ B, C, F B/ B, C, D, E, F C/ B, C, D, F D/ B, C, E, F

B

U08 - Q018 Given a weighted graph below and you are using the Dijkstra algorithm to find the shortest path from the vertex A to the vertex F. What is the label of the vertex E when the shortest path from A to F is determined? A/ 14 B/ 11 C/ 19 D/ infinity

A

U08 - Q019 Suppose a multigraph G is given by the adjacency matrix below. Which of the followings is the Euler cycle? A/ A, B, C, B, D, A B/ A, B, C, D, A C/ A, C, D, B. A D/ A, B, C, B, D, C, A

B

U08 - Q020 Suppose a graph G is given by the adjacency matrix below. Which of the followings is the Hamilton cycle? A/ A, B, C, D, E, C, A B/ A, D, E, C, B, A C/ A, B, C, D, E, A D/ A, C, D, E, B, A

B

U08 - Q021 Assume in directed graph edge uv means "vertex v depends on vertex u". What is valid topological sort of the graph shown below: A/ C, B, A, D, G, F, E, H B/ A, B, D, C, E, F, G, H C/ C, B, A, F, E, D, G, H D/ C, B, A, H, E, F, G, D

A

U08 - Q026 Which of the following algorithms in graphs can be implemented by extending Depth First Search algorithm? A/ Cycle detection. B/ The Chinese Postman Tour C/ Finding the shortest path (Dijkstra algorithm) D/ All of the others.

A

U08 - Q027 Which of the following statements are true: A/ All of the others. B/ The complexity of Breadth First Search algorithm is O(|V| + |E|). C/ The Depth First Search for graph traversal generates a spanning tree if original graph is connectivity and undirected.

A

U08 - Q028 Algorithms are applied to graphs: A/ All of the others. B/ Depth First Search. C/ Breadth First Search.

A

U08 - Q030 What is the breadth-first traversal from the vertex D of a graph below? (visit nodes in ABC order if there are some nodes having the same selection ability) A/ D, C, B, F, A, E, G, H B/ D, C, B, F, A, E, C/ D, C, F, B, E, A, G, H D/ D, C, B, F, A, G, E, H

B

U08 - Q031 Given a weighted graph below and you are using the Dijkstra algorithm to find the shortest path from the vertex A to the vertex F. What are the correct order of vertices selected into the set S until the vertex F is selected? (Each step a vertex with minimal current distance is selected into S). A/ A, C, D, F B/ A, B, C, E, D, F C/ A, B, C, E, D/ A, C, E, F

C

U08 - Q032 Given a weighted graph below and you are using the Dijkstra algorithm to find the shortest path from the vertex A to the vertex B. What is the label of the vertex D when the shortest path from A to B is determined? A /21 B/ 17 C/ 5 D/ infinity

D

U08 - Q033 Given a weighted graph below. What is the total edge-weight of the minimum spanning tree of G? A/ 31 B/ 25 C/ 40 D/ 48

A

U08 - Q034 Given a graph below and colors numbered 1, 2, 3, ... are assigned to vertices with the sequential coloring algorithm that orders vertices by alphabetical order (i.e. the vertex labeled A comes first, then the vertex B,...) What is the color of the vertex E? A/ 1 B/ 2 C/ 3 D/ 4 E/ 5

A

U08-Q035 A graph can be used to show relationships. From the following list of people belonging to the same club (vertices) and their friendships (edges): Peope = {George, Jim, Jean, Frank, Fred, John, Susan} Friendship = {(George, Jean), (Frank, Fred), (George, John), (Jim, Fred), (Jim, Frank), (Jim, Susan), (Susan, Frank)} Find all friends of friends of Jean. A/ John and Jean Fred, B/ Frank and Susan C/ Jim and George D/ Nobody

A

U08-Q036 Which of the following statements is false? A/ The number of 0 entries in an adjacency matrix is twice the number of edges. B/ The number of non-zero entries in an incidence matrix for a graph is 2|E|. C/ If the incidence matrix for a graph has n rows and n(n -1)/2 columns, then the graph must be a complete graph. D/ The adjacency matrix of a simple graph is symmetric


Ensembles d'études connexes

Chapter 11: Video - Sriracha BA101

View Set

accounting chapter 7-9 multiple choice

View Set

albert personalities/testing and individual differences

View Set