22. Graphs and Applications - 9 Questions


22. Graphs and Applications

22. Graphs and Applications

9 Questions
Created by Y. Daniel Liang - http://www.cs.armstrong.edu/liang/index.html
Free
This Python quiz is aimed at students, enthusiasts and job seekers with little or no programming experience. It aims to provide them with an understanding of the role of computers and python programming language.
  1. A ____ is an edge that links a vertex to itself. 



    loop
    parallel edge
    weighted edge
    directed edge

    View Answer | Discuss in forum
  2. If two vertices are connected by two or more edges, these edges are called ______.



    loop
    parallel edge
    weighted edge
    directed edge

    View Answer | Discuss in forum
  3. A _________ is the one in which every two pairs of vertices are connected.



    complete graph
    incomplete graph
    weighted graph
    directed graph

    View Answer | Discuss in forum
  4. What is the number of edges in a complete graph of n vertices?



    n
    n - 1
    n(n-1)/2
    n*n

    View Answer | Discuss in forum
  5. What is the number of edges in a tree of n vertices?



    n
    n - 1
    n(n-1)/2
    n*n

    View Answer | Discuss in forum
  6. The _______ search of a graph first visits a vertex, then it recursively visits all the vertices adjacent to that vertex.



    depth-first
    breadth-first
    depth-last
    breadth-last

    View Answer | Discuss in forum
  7. The _______ the breadth-first search of a graph first visits a vertex, then all its adjacent vertices, then all the vertices adjacent to those vertices, and so on.



    depth-first
    breadth-first
    depth-last
    breadth-last

    View Answer | Discuss in forum
  8. The time complexity of the DFS algorithm is O(|E| + |V|).



    True
    False
    Can't say
    none of these

    View Answer | Discuss in forum
  9. The time complexity of the BFS algorithm is O(|E| + |V|).



    True
    False
    Can't say
    None of these

    View Answer | Discuss in forum