यह रहे डेटा स्ट्रक्चर (Data Structures) के महत्वपूर्ण टॉपिक्स — Arrays (1D/2D), Linked Lists, Stacks, और Queues — पर आधारित 50 महत्वपूर्ण MCQs (with answers):
🧮 Section 1: Arrays (1D/2D) — 12 MCQs
-
Which of the following is the correct way to declare a 1D array in C?
a)int arr[5];✅
b)int arr();
c)array int arr[5];
d)int[5] arr; -
Array index always starts from:
a) 1
b) 0 ✅
c) -1
d) Depends on language -
Which of the following is used to dynamically allocate memory in C?
a)new
b)malloc()✅
c)alloc()
d)array() -
What is the output of accessing out-of-bounds index in array?
a) Error
b) Exception
c) Garbage value ✅
d) 0 -
Which of these data structures is best suited for matrix operations?
a) Linked List
b) Queue
c) 2D Array ✅
d) Stack -
In a 2D array
int a[3][4], how many total elements are there?
a) 7
b) 12 ✅
c) 10
d) 3 -
Time complexity to access any element in an array:
a) O(n)
b) O(1) ✅
c) O(log n)
d) O(n²) -
Which of these supports random access?
a) Array ✅
b) Stack
c) Queue
d) Linked List -
What is a sparse matrix?
a) A matrix with large elements
b) A matrix with most elements 0 ✅
c) Matrix with only one column
d) Matrix with only one row -
Which technique is used to represent sparse matrix efficiently?
a) Linked List ✅
b) Array
c) Queue
d) Stack -
Which of the following allows direct access by index?
a) Stack
b) Queue
c) Array ✅
d) Linked List -
Which data structure is best for storing tabular data like Excel sheets?
a) Stack
b) 1D Array
c) 2D Array ✅
d) Queue
🔗 Section 2: Linked Lists — 12 MCQs
-
Which of the following is not a type of Linked List?
a) Single Linked List
b) Double Linked List
c) Circular Linked List
d) Cross Linked List ✅ -
In a singly linked list, each node contains:
a) Data only
b) Data and two pointers
c) Data and one pointer ✅
d) None -
Which pointer in linked list helps traverse backwards?
a) prev ✅
b) next
c) head
d) null -
Which operation is not efficient in linked list as compared to array?
a) Insertion
b) Deletion
c) Accessing element by index ✅
d) Dynamic memory allocation -
Head pointer in linked list refers to:
a) Last node
b) First node ✅
c) Middle node
d) NULL -
Which of these is used to terminate the last node in singly linked list?
a) 1
b) NULL ✅
c) 0
d) -1 -
In circular linked list, the last node points to:
a) Itself
b) NULL
c) Head ✅
d) Next node -
Which of these is not possible in singly linked list?
a) Insert at beginning
b) Delete at end
c) Traverse backwards ✅
d) Traverse forward -
Which pointer type is used in doubly linked list?
a) Only next
b) Only prev
c) Both next and prev ✅
d) None -
Insertion at beginning of linked list is:
a) O(n)
b) O(1) ✅
c) O(log n)
d) O(n²) -
Linked list is better than array in:
a) Searching
b) Accessing elements
c) Memory allocation ✅
d) Indexing -
Which is true for linked list?
a) Uses contiguous memory
b) Allows random access
c) Stores elements with dynamic memory ✅
d) Fixed size
📚 Section 3: Stacks — 13 MCQs
-
Stack follows which order?
a) FIFO
b) LIFO ✅
c) FILO
d) Random -
Which operation inserts element in stack?
a) pop()
b) push() ✅
c) insert()
d) add() -
What does pop() do in a stack?
a) Deletes top element ✅
b) Deletes bottom element
c) Inserts new item
d) Peeks item -
What is underflow in stack?
a) Stack full
b) Stack empty ✅
c) Stack overflow
d) Memory leak -
What is overflow in stack?
a) Stack full ✅
b) Stack empty
c) Stack sorted
d) Stack unsorted -
Which of these is not a stack application?
a) Expression evaluation
b) Function call management
c) Browser backtracking
d) Job Scheduling ✅ -
Time complexity of push and pop:
a) O(n)
b) O(1) ✅
c) O(log n)
d) O(n²) -
Which data structure is used for undo feature in editors?
a) Queue
b) Stack ✅
c) Linked List
d) Array -
Which of the following is not a valid stack operation?
a) push
b) pop
c) peek
d) insert ✅ -
Function used to look at top value of stack:
a) top()
b) peek() ✅
c) value()
d) show() -
In stack, push operation happens at:
a) Bottom
b) Middle
c) Top ✅
d) Random -
Which notation uses stacks?
a) Infix
b) Prefix
c) Postfix ✅
d) Complex -
Which data structure is used for recursion?
a) Queue
b) Linked List
c) Stack ✅
d) Tree
📥 Section 4: Queues — 13 MCQs
-
Queue follows which principle?
a) LIFO
b) FIFO ✅
c) FILO
d) Random -
Which operation inserts element into queue?
a) delete()
b) enqueue() ✅
c) pop()
d) push() -
Which operation removes element from queue?
a) push()
b) delete()
c) dequeue() ✅
d) insert() -
Front of the queue refers to:
a) Last element
b) First inserted element ✅
c) Top
d) Bottom -
Which queue handles priorities?
a) Simple Queue
b) Circular Queue
c) Double-ended Queue
d) Priority Queue ✅ -
Which of the following is not a type of queue?
a) Circular Queue
b) Deque
c) Priority Queue
d) Hash Queue ✅ -
Queue is best used in:
a) Call center systems ✅
b) Undo feature
c) Backtracking
d) Memory management -
Time complexity of enqueue and dequeue operations:
a) O(n)
b) O(1) ✅
c) O(log n)
d) O(n²) -
In circular queue, rear is incremented by:
a) rear++
b) (rear + 1) % size ✅
c) rear--
d) front + 1 -
Double-ended queue (Deque) allows insertion and deletion:
a) Only at front
b) Only at rear
c) From both ends ✅
d) None -
Queue overflow occurs when:
a) Queue is empty
b) Queue is full ✅
c) Front == Rear
d) None -
Which operation is used to check first element in queue?
a) pop()
b) peek() ✅
c) front()
d) top() -
Real-life example of queue:
a) Stack of books
b) Browser history
c) Ticket line ✅
d) Function calls