-->

Data Structures MCQ's Questions 1 | diplomachakhazana

 






Data Structures MCQ's Questions 2

Data Structures MCQ's Questions 3


Q.1. What is the worst case run-time complexity of binary search algorithm?

  1. Ο(n2)
  2. Ο(nlog n)
  3. Ο(n3)
  4. Ο(n)

Answer:- (4)

Q.2. If there's no base criteria in a recursive program, the program will

  1. not be executed.
  2. execute until all conditions match.
  3. execute infinitely.
  4. obtain progressive approach.

Answer:- (3)

Q.3. The depth of complete binary tree is given by

  1. Dn = n log2n
  2. Dn = n log2n +1
  3. Dn = log2n
  4. Dn = log2n + 1

Answer:- (4)

Q.4. The postfix form of the expression (A+ B)*(C*D- E)*F / G is?

  1. AB+ CD*E – FG /**
  2. AB + CD* E – F **G /
  3. AB + CD* E – *F *G /
  4. AB + CDE * – * F *G /

Answer:- (3)

Q.5. Which data structure is needed to convert infix notation to postfix notation?

  1. Branch
  2. Tree
  3. Queue
  4. Stack

Answer:- (4)

Q.6. One can convert a binary tree to its mirror image by traversing it in

  1. Inorder
  2. Preorder
  3. Postorder
  4. None of the above

Answer:- (3)

Q.7. For an undirected graph with n vertices and e edges, the sum of degree of each vertex is equal to

  1. 2n
  2. 2e
  3. (e2+1)/2
  4. (2n-1)/2

Answer:- (2)

Q.8.  A data structure in which elements can be inserted or deleted at/from both the ends but not in the middle is?

  1. Queue
  2. Circular queue
  3. Dequeue
  4. Priority queue

Answer:- (3)

Q.9. What would be the asymptotic time complexity to add a node at the end of singly linked list, if the pointer is initially pointing to the head of the list?

  1. O(1)
  2. O(n)
  3. θ(n)
  4. θ(1)

Answer:- (3)

Q.10. Consider the following definition in c programming language

struct node
{
    int data;
    struct node * next;
}
typedef struct node NODE;
NODE *ptr;

Which of the following c code is used to create new node?

  1. ptr = (NODE*)malloc(sizeof(NODE));
  2. ptr = (NODE*)malloc(NODE);
  3. ptr = (NODE*)malloc(sizeof(NODE*));
  4. ptr = (NODE)malloc(sizeof(NODE));

Answer:- (1)

Q.11. Which of the following points is/are not true about Linked List data structure when it is compared with array?

  1. Arrays have better cache locality that can make them better in terms of performance
  2. It is easy to insert and delete elements in Linked List
  3. Random access is not allowed in a typical implementation of Linked Lists
  4. Access of elements in linked list takes less time than compared to arrays

Answer:- (4)

Q.12. You are given pointers to first and last nodes of a singly linked list, which of the following operations are dependent on the length of the linked list?

  1. Delete the first element
  2. Insert a new element as a first element
  3. Delete the last element of the list
  4. Add a new element at the end of the list

Answer:- (3)

Q.13. What is a memory efficient double linked list?

  1. Each node has only one pointer to traverse the list back and forth
  2. The list has breakpoints for faster traversal
  3. An auxiliary singly linked list acts as a helper list to traverse through the doubly linked list
  4. A doubly linked list that uses bitwise AND operator for storing addresses

Answer:- (1)

Q.14. How do you calculate the pointer difference in a memory efficient double linked list?

  1. head xor tail
  2. pointer to previous node xor pointer to next node
  3. pointer to previous node – pointer to next node
  4. pointer to next node – pointer to previous node

Answer:- (2)

Q.15. Which of the following application makes use of a circular linked list?

  1. Undo operation in a text editor
  2. Recursive function calls
  3. Allocating CPU to resources
  4. Implement Hash Tables

Answer:- (3)

Q.16. Array implementation of Stack is not dynamic, which of the following statements supports this argument?

  1. space allocation for array is fixed and cannot be changed during run-time
  2. user unable to give the input for stack operations
  3. a runtime exception halts execution
  4. improper program compilation

Answer:- (1)

Q.17. Which of the following data structures can be used for parentheses matching?

  1. n-ary tree
  2. queue
  3. priority queue
  4. stack

Answer:- (4)

Q.18. What is the time complexity of enqueue operation?

  1. O(logn)
  2. O(nlogn)
  3. O(n)
  4. O(1)

Answer:- (4)

Q.19. In case of insertion into a linked queue, a node borrowed from the __________ list is inserted in the queue.

  1. AVAIL
  2. FRONT
  3. REAR
  4. NULL

Answer:- (1)

Q.20. Which of the following is true about linked list implementation of queue?

  1. In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes must be removed from end
  2. In push operation, if new nodes are inserted at the beginning, then in pop operation, nodes must be removed from the beginning
  3. In push operation, if new nodes are inserted at the end, then in pop operation, nodes must be removed from end
  4. In push operation, if new nodes are inserted at the end, then in pop operation, nodes must be removed from beginning.

Answer:- (1)

0 Comments