daa mcq

Upload: linkeshwar-lee

Post on 10-Feb-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/22/2019 DAA MCQ

    1/3

    1. Two main measures for the efficiency of an algorithm are Processor and memory Complexity and capacity Time and space Data and space

    2.

    The total number of comparisons in a bubble sort is 0(log n) 0(n log n) 0(n) None of the above

    3. The upper bound of computing time of m coloring decision problem is O(nm) O(nm) O(nmn) O(nmmn)

    4. The space factor when determining the efficiency of algorithm is measured by

    Counting the maximum memory needed by the algorithm Counting the minimum memory needed by the algorithm Counting the average memory needed by the algorithm Counting the maximum disk space needed by the algorithm

    5. The time factor when determining the efficiency of algorithm is measured by Counting microseconds Counting the number of key operations Counting the number of statements Counting the kilobytes of algorithm

    6. The Worst case occur in linear search algorithm when Item is somewhere in the middle of the array

    Item is not in the array at all Item is the last element in the array Item is the last element in the array or is not there at all

    7. The concept of order Big O is important because It can be used to decide the best algorithm that solves a given problem It determines the maximum size of a problem that can be solved in a given given amount of

    time

    It is the lower bound of the growth rate of algorithm Both A and B

    8. The worst case running time to search for an element in a balanced binary search tree withn2nelements is

    T(nlogn)

    T(n2n) T(n) T(logn)

    9. Which of the following statements are TRUE?(1) The problem of determining whether there exists a cycle in an undirected graph is in P.

    (2) The problem of determining whether there exists a cycle in an undirected graph is in NP.

  • 7/22/2019 DAA MCQ

    2/3

    (3) If a problem A is NP-Complete, there exists a non-deterministic polynomial time algorithm to

    solve A.

    1,2 and 3 1 and 2 only 2 and 3 only 1 and 3 only

    10.Level of any node of a tree is Height of its left subtree minus height of its right subtree Height of its right subtree minus height of its left subtree Its distance from the root None of these

    11.The number of vertices of odd degree in a graph is Always zero Either even or odd Always odd Always even

    12.A given connected graph G is a Euler graph , if and only if all vertices of G are of Same degree Even degree Odd degree Different degree

    13.Tree Is a bipartite graph With n node contains n-1 edges Is a connected graph All of these

    14.Leaves of which of the following trees are at the same level ? Binary tree B-tree AVL-tree Expression tree

    15.Let A be an adjacency matrix of a graph G. The th ij entry in the matrix K A , gives The number of paths of length K from vertex Vi to vertex Vj. Shortest path of K edges from vertex Vi to vertex Vj. Length of a Eulerian path from vertex Vi to vertex Vj. Length of a Hamiltonian cycle from vertex Vi to vertex Vj.

    16.Given a binary tree whose inorder and preorder traversal are given byInorder : EICFBGDJHK Preorder: BCEIFDGHJK

    The post order traversal of the above binary tree is

    IEFCGJKHDB IEFCJGKHDB IEFCGKJHDB IEFCGJKDBH

  • 7/22/2019 DAA MCQ

    3/3

    17. In a Heap tree Values in a node is greater than every value in left sub tree and smaller than right sub tree Values in a node is greater than every value in children of it Both of above conditions applies None of above conditions applies

    18.Breadth first traversal is a method to traverse All successors of a visited node before any successors of any of those successors A single path of the graph as far it can go Graph using shortest path None of these

    19.For an undirected graph with n vertices and e edges, the sum of the degree of each vertex isequal to

    2n (2n-1)/2 2e e2/2

    20.The operation of processing each element in the list is known as Sorting Merging Inserting Traversal

    21.Two isomorphic graphs must have Equal number of vertices Same number of edges Same number of vertices All of the above

    22.The spanning tree of connected graph with 10 vertices contains

    9 edges 11 edges 10 edges 9 vertices

    23.A search technique where we keep expanding nodes with least accumulated cost so far is called Hill climbing Branch and bound Best first Divide and conquer

    24.A desirable choice for the partitioning element in quick sort is First element of the list

    Last element of the list Randomly chosen element of the list Median of the list

    25.Both P and NP are closed under the operation of Union Intersection Concatenation Kleene