Data Structures MCQ's Questions Set 1
Q.1. What is the worst case run-time complexity of binary search algorithm?
- Ο(nlog n)
Q.2. If there's no base criteria in a recursive program, the program will
- not be executed.
- execute until all conditions match.
- execute infinitely.
- obtain progressive approach.
Q.3. The depth of complete binary tree is given by
- Dn = n log2n
- Dn = n log2n +1
- Dn = log2n
- Dn = log2n + 1
Q.4. The postfix form of the expression (A+ B)*(C*D- E)*F / G is?
- AB+ CD*E – FG /**
- AB + CD* E – F **G /
- AB + CD* E – *F *G /
- AB + CDE * – * F *G /
Q.5. Which data structure is needed to convert infix notation to postfix notation?
Q.6. One can convert a binary tree to its mirror image by traversing it in
- None of the above
Q.7. For an undirected graph with n vertices and e edges, the sum of degree of each vertex is equal to
Q.8. A data structure in which elements can be inserted or deleted at/from both the ends but not in the middle is?
- Circular queue
- Priority queue
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?
Q.10. Consider the following definition in c programming language
struct node * next;
typedef struct node NODE;
Which of the following c code is used to create new node?
- ptr = (NODE*)malloc(sizeof(NODE));
- ptr = (NODE*)malloc(NODE);
- ptr = (NODE*)malloc(sizeof(NODE*));
- ptr = (NODE)malloc(sizeof(NODE));
Q.11. Which of the following points is/are not true about Linked List data structure when it is compared with array?
- Arrays have better cache locality that can make them better in terms of performance
- It is easy to insert and delete elements in Linked List
- Random access is not allowed in a typical implementation of Linked Lists
- Access of elements in linked list takes less time than compared to arrays
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?
- Delete the first element
- Insert a new element as a first element
- Delete the last element of the list
- Add a new element at the end of the list
Q.13. What is a memory efficient double linked list?
- Each node has only one pointer to traverse the list back and forth
- The list has breakpoints for faster traversal
- An auxiliary singly linked list acts as a helper list to traverse through the doubly linked list
- A doubly linked list that uses bitwise AND operator for storing addresses
Q.14. How do you calculate the pointer difference in a memory efficient double linked list?
- head xor tail
- pointer to previous node xor pointer to next node
- pointer to previous node – pointer to next node
- pointer to next node – pointer to previous node
Q.15. Which of the following application makes use of a circular linked list?
- Undo operation in a text editor
- Recursive function calls
- Allocating CPU to resources
- Implement Hash Tables
Q.16. Array implementation of Stack is not dynamic, which of the following statements supports this argument?
- space allocation for array is fixed and cannot be changed during run-time
- user unable to give the input for stack operations
- a runtime exception halts execution
- improper program compilation
Q.17. Which of the following data structures can be used for parentheses matching?
- n-ary tree
- priority queue
Q.18. What is the time complexity of enqueue operation?
Q.19. In case of insertion into a linked queue, a node borrowed from the __________ list is inserted in the queue.
Q.20. Which of the following is true about linked list implementation of queue?
- In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes must be removed from end
- In push operation, if new nodes are inserted at the beginning, then in pop operation, nodes must be removed from the beginning
- In push operation, if new nodes are inserted at the end, then in pop operation, nodes must be removed from end
- In push operation, if new nodes are inserted at the end, then in pop operation, nodes must be removed from beginning.
Data Structures Interview Questions Set 1 Click here
Data Structures & Algorithms(DSA) MCQ's Questions Set 1
Data Structures and Algorithm (DSA) Queue MCQ'S Question Set 2
Technical-MCQs For Placement Preparation