Site icon DataFlair

Data Structure MCQ Online Test

data structure mcq online test

Free Data Structures and Algorithms courses with real-time projects Start Now!!

Welcome to online MCQ Test on data structure and algorithm. This quiz contains 20 questions based on data structures and algorithms and covers almost all the topics for your revision. Let’s start!!!

Time limit: 0

Quiz Summary

0 of 20 Questions completed

Questions:

Information

You have already completed the quiz before. Hence you can not start it again.

Quiz is loading…

You must sign in or sign up to start the quiz.

You must first complete the following:

Results

Quiz complete. Results are being recorded.

Results

0 of 20 Questions answered correctly

Your time:

Time has elapsed

You have reached 0 of 0 point(s), (0)

Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)

Categories

  1. Not categorized 0%
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  1. Current
  2. Review / Skip
  3. Answered
  4. Correct
  5. Incorrect
  1. Question 1 of 20
    1. Question
    1. Suppose a binary search tree has the inorder traversal as: 10, 20, 30, 40, 50, 60, 70. What is the output of the following code segment?

    void traverse(struct node* ptr){

        if(ptr){

            cout << ptr->data;

            traverse(ptr->right);

            traverse(ptr->left);

        }

    }

    Correct
    Incorrect
  2. Question 2 of 20
    2. Question

    Which of the following statement is false for a bubble sort?

    Correct
    Incorrect
  3. Question 3 of 20
    3. Question

    Which of the following methods is best suitable to solve a fractional knapsack problem?

    Correct
    Incorrect
  4. Question 4 of 20
    4. Question

    Which of the following is not an application of dynamic programming? 

    Correct
    Incorrect
  5. Question 5 of 20
    5. Question

    Which of the following statements is false with respect to Depth-first search?

    Correct
    Incorrect
  6. Question 6 of 20
    6. Question

    Consider an empty stack. The order of performing the operations is: push(21), push(52), push(16), pop(), pop(), push(25), push(22), push(60), pop(), pop(), push(15), pop().

    Which values are finally present in the stack after performing these operations?

    Correct
    Incorrect
  7. Question 7 of 20
    7. Question

    What is Karatsuba’s algorithm used for?

    Correct
    Incorrect
  8. Question 8 of 20
    8. Question

    Which of the following operations in a stack can be implemented only during actual implementation and not as an abstract data type? An unordered list contains n distinct elements. 

    Correct
    Incorrect
  9. Question 9 of 20
    9. Question

    What does the following code depict?

    #define Size 5 //Maximum possible size of a stack

     

    struct stack{

        int data[SIZE];

        int TOP;

    }

     

    void fun(){

        if(ptr -> TOP == SIZE-1)

            return;

    }

     

    Correct
    Incorrect
  10. Question 10 of 20
    10. Question

    What is the minimum number of nodes in a complete binary tree of height ‘h’?

    Correct
    Incorrect
  11. Question 11 of 20
    11. Question

    How many binary trees are possible if the preorder of the binary tree is ‘ABC’

    Correct
    Incorrect
  12. Question 12 of 20
    12. Question

    Which of the following combinations does not produce a unique binary tree?

    Correct
    Incorrect
  13. Question 13 of 20
    13. Question

     What is the worst-case complexity of the following code?

    for(i=1; i<=n; i=i*2){

        for(j=1; j<=n; j=j*2)

            cout << “Hello world”;

    }

     

    Correct
    Incorrect
  14. Question 14 of 20
    14. Question

    How many min-heaps can we construct using 5 distinct keys?

    Correct
    Incorrect
  15. Question 15 of 20
    15. Question

    Let V denote the vertices in a graph and E denote the edges in a graph. What is the time complexity for Bellman Ford’s algorithm?

    Correct
    Incorrect
  16. Question 16 of 20
    16. Question

     Which of the following statement is false with respect to Dijkstra’s algorithm?

    Correct
    Incorrect
  17. Question 17 of 20
    17. Question

    What time does it take to delete an element from a binary heap?

    Correct
    Incorrect
  18. Question 18 of 20
    18. Question

    Which of the following statements is true?

    Correct
    Incorrect
  19. Question 19 of 20
    19. Question

    In which case, the complexity is much more difficult to analyze?

    Correct
    Incorrect
  20. Question 20 of 20
    20. Question

    Which of the following is not an application of divide and conquer?

    Correct
    Incorrect

Summary

This was online test based on data structure and algorithm containing 20 MCQ questions. Covering MCQs is very important from the aspect of clearing written interview rounds for many IT companies. Hope this collection of questions helped you a lot.

Exit mobile version