DATA STRUCTURES MCQs with answers |part 1| - letsbug
Data structures MCQs(multiple choice questions) with answers we have 25 questions sets.
1. Process of inserting an element in stack is called _________.
- Create
- Push
- Evaluation
- Pop
Answer: 2 : Push
2. Process of removing and element from stack is called _______.
- Create
- Push
- Evaluation
- Pop
Answer: 4 : Pop
3. In a stack, if a user tries to remove an element from empty stack it is called ________.
- Underflow
- Empty collection
- Overflow
- Garbage Collection
Answer: 1 : Underflow
4. Push an element into already having five elements and stack size of 5 then stack becomes
- Overflow
- Crash
- Underflow
- User flow
Answer: 1: Overflow.
5. What data structure would you mostly likely see in a non recursive implementation of a recursive algorithm?
- Linked List
- Stack
- Queue
- Tree
Answer: 2 : Stack
6. The process of accessing data stored in a serial access memory is similar to manipulating data on a ________.
- Heap
- Binary Tree
- Array
- Stack
Answer: 4 : Stack
7. A linear list of elements in which deletion can be done from one end(front) and insertion can take place only at the other end (rear) is known as a?
- Queue
- Stack
- Tree
- Linked List
Answer: 1 : Queue
8. The data structure required for Breadth First Traversal on a graph is?
- Stack
- Array
- Queue
- Tree
Answer: 3: Queue
9. A queue follows _______.
- FIFO (First In First Out) principle
- LIFO (Last In First Out) principle
- Ordered array
- Linear tree
Answer: 1 : FIFO(First In First Out) principle
10. Circular Queue is also known as ________.
- Ring Buffer
- Square Buffer
- Rectangle Buffer
- Curve Buffer
Answer: 1: Ring Buffer
11. If the elements "A", "B", "C" and "D" are placed in a queue and are deleted one at a time, in what order will they be removed?
- ABCD
- DCBA
- DCAB
- ABDC
Answer: 1: ABCD
12. 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 : Dequeue
13. A normal queue, if implemented using an array of size MAX_SIZE, gets full when.
- Rear = MAX_SIZE - 1
- Front = (rear + 1) mod MAX_SIZE
- Front = rear + 1
- Rear = front
Answer: 1 : Rear = MAX_SIZE - 1
14. A linear collection of data elements where the linear node is given by means of pointer is called?
- Linked List
- Node List
- Primitive List
- Unordered List
Answer: 1: Linked List
15. Consider an implementation of unsorted singly linked list. Suppose it has its representation with a head pointer only. Give the representation, when of the following operations can be implemented in O(1) time?
i. Insertion at the front of the linked list
ii. Insertion at the end of the linked list
iii. Deletion of the front node of the linked list
iv. Deletion of the last node of the linked list
- i and ii
- i and iii
- i, ii and iii
- i, ii and iv
Answer: 2: i and iii
16. In linked list each node contain minimum of two fields. One field is data field to store the data second field is?
- Pointer to character
- Pointer to integer
- Pointer to node
- Node
Answer: 3 : Pointer to node
17. 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)
- 0(n)
- 0(1)
Answer: 1: O(1)
18. What would be the asymptotic time complexity to insert and element at the front of the linked list(head is known)?
- O(1)
- O(n)
- O(n2)
- O(n3)
Answer: 1 : O(1)
19. the concatenation of two list can be performed in O(1) time. Which of the following variation of linked list can be used?
- Singly linked list
- doubly linked list
- Circular doubly linked list
- Array implementation of list
Answer: 2 : doubly linked list
20. Consider the following definition of C programming language
struct node{ int data; struct node * next;}typedef struct node NODE;NODE *ptr;
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:
ptr = (NODE*)malloc(sizeof(NODE));21. Linked list is considered as an example of ________ type of memory allocation.
- Dynamic
- Static
- Compile time
- Heap
Answer: 1 : Dynamic
22. In linked list implementation, a node carries information regarding _________.
- Data
- Link
- Data and Link
- Node
Answer: 3: Data and Link
23. What is a memory efficient doubly 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 : Each node has only one pointer to traverse the list back and forth
24. What differentiates a circular linked list from a normal linked list?
- You cannot have the 'next' pointer point to null in a circular linked list
- It is faster to traverse the circular linked list
- You may or may not have the 'next' pointer point to null in a circular linked list
- Head node is known in circular linked list.
Answer: 1 : You cannot have the 'next' pointer point to null in a circular linked list
25. Which of the following application makes use of a circular linked list?
- Undo operation in a text editor
- Recursive functions calls
- Allocating CPU to resources
- Implement Hash Tables
Answer: 3 : Allocating CPU to resources
Another set of 25 MCQs click here.
Comments
Post a Comment