Data Structures MCQ's Questions Set 1
Q.1. What is the worst case run-time complexity of binary search algorithm?
- Ο(n2)
- Ο(nlog n)
- Ο(n3)
- Ο(n)
Answer:- (4)
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.
Answer:- (3)
Q.3. The depth of complete binary tree is given by
- Dn = n log2n
- Dn = n log2n +1
- Dn = log2n
- Dn = log2n + 1
Answer:- (4)
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 /
Answer:- (3)
Q.5. Which data structure is needed to convert infix notation to postfix notation?
- Branch
- Tree
- Queue
- Stack
Answer:- (4)
Q.6. One can convert a binary tree to its mirror image by traversing it in
- Inorder
- Preorder
- Postorder
- 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
- 2n
- 2e
- (e2+1)/2
- (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?
- Queue
- Circular queue
- Dequeue
- 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?
- O(1)
- O(n)
- θ(n)
- θ(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?
- ptr = (NODE*)malloc(sizeof(NODE));
- ptr = (NODE*)malloc(NODE);
- ptr = (NODE*)malloc(sizeof(NODE*));
- 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?
- 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
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?
- 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
Answer:- (3)
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
Answer:- (1)
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
Answer:- (2)
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
Answer:- (3)
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
Answer:- (1)
Q.17. Which of the following data structures can be used for parentheses matching?
- n-ary tree
- queue
- priority queue
- stack
Answer:- (4)
Q.18. What is the time complexity of enqueue operation?
- O(logn)
- O(nlogn)
- O(n)
- 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.
- AVAIL
- FRONT
- REAR
- NULL
Answer:- (1)
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.
Answer:- (1)
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