यह रहे डेटा स्ट्रक्चर (Data Structures) के महत्वपूर्ण टॉपिक्स — Arrays (1D/2D), Linked Lists, Stacks, और Queues — पर आधारित 50 महत्वपूर्ण MCQs (with answers):

 यह रहे डेटा स्ट्रक्चर (Data Structures) के महत्वपूर्ण टॉपिक्स — Arrays (1D/2D), Linked Lists, Stacks, और Queues — पर आधारित 50 महत्वपूर्ण MCQs (with answers):


🧮 Section 1: Arrays (1D/2D) — 12 MCQs

  1. 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;

  2. Array index always starts from:
    a) 1
    b) 0 ✅
    c) -1
    d) Depends on language

  3. Which of the following is used to dynamically allocate memory in C?
    a) new
    b) malloc()
    c) alloc()
    d) array()

  4. What is the output of accessing out-of-bounds index in array?
    a) Error
    b) Exception
    c) Garbage value ✅
    d) 0

  5. Which of these data structures is best suited for matrix operations?
    a) Linked List
    b) Queue
    c) 2D Array ✅
    d) Stack

  6. In a 2D array int a[3][4], how many total elements are there?
    a) 7
    b) 12 ✅
    c) 10
    d) 3

  7. Time complexity to access any element in an array:
    a) O(n)
    b) O(1) ✅
    c) O(log n)
    d) O(n²)

  8. Which of these supports random access?
    a) Array ✅
    b) Stack
    c) Queue
    d) Linked List

  9. 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

  10. Which technique is used to represent sparse matrix efficiently?
    a) Linked List ✅
    b) Array
    c) Queue
    d) Stack

  11. Which of the following allows direct access by index?
    a) Stack
    b) Queue
    c) Array ✅
    d) Linked List

  12. 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

  1. 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 ✅

  2. In a singly linked list, each node contains:
    a) Data only
    b) Data and two pointers
    c) Data and one pointer ✅
    d) None

  3. Which pointer in linked list helps traverse backwards?
    a) prev ✅
    b) next
    c) head
    d) null

  4. 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

  5. Head pointer in linked list refers to:
    a) Last node
    b) First node ✅
    c) Middle node
    d) NULL

  6. Which of these is used to terminate the last node in singly linked list?
    a) 1
    b) NULL ✅
    c) 0
    d) -1

  7. In circular linked list, the last node points to:
    a) Itself
    b) NULL
    c) Head ✅
    d) Next node

  8. Which of these is not possible in singly linked list?
    a) Insert at beginning
    b) Delete at end
    c) Traverse backwards ✅
    d) Traverse forward

  9. Which pointer type is used in doubly linked list?
    a) Only next
    b) Only prev
    c) Both next and prev ✅
    d) None

  10. Insertion at beginning of linked list is:
    a) O(n)
    b) O(1) ✅
    c) O(log n)
    d) O(n²)

  11. Linked list is better than array in:
    a) Searching
    b) Accessing elements
    c) Memory allocation ✅
    d) Indexing

  12. 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

  1. Stack follows which order?
    a) FIFO
    b) LIFO ✅
    c) FILO
    d) Random

  2. Which operation inserts element in stack?
    a) pop()
    b) push() ✅
    c) insert()
    d) add()

  3. What does pop() do in a stack?
    a) Deletes top element ✅
    b) Deletes bottom element
    c) Inserts new item
    d) Peeks item

  4. What is underflow in stack?
    a) Stack full
    b) Stack empty ✅
    c) Stack overflow
    d) Memory leak

  5. What is overflow in stack?
    a) Stack full ✅
    b) Stack empty
    c) Stack sorted
    d) Stack unsorted

  6. Which of these is not a stack application?
    a) Expression evaluation
    b) Function call management
    c) Browser backtracking
    d) Job Scheduling ✅

  7. Time complexity of push and pop:
    a) O(n)
    b) O(1) ✅
    c) O(log n)
    d) O(n²)

  8. Which data structure is used for undo feature in editors?
    a) Queue
    b) Stack ✅
    c) Linked List
    d) Array

  9. Which of the following is not a valid stack operation?
    a) push
    b) pop
    c) peek
    d) insert ✅

  10. Function used to look at top value of stack:
    a) top()
    b) peek() ✅
    c) value()
    d) show()

  11. In stack, push operation happens at:
    a) Bottom
    b) Middle
    c) Top ✅
    d) Random

  12. Which notation uses stacks?
    a) Infix
    b) Prefix
    c) Postfix ✅
    d) Complex

  13. Which data structure is used for recursion?
    a) Queue
    b) Linked List
    c) Stack ✅
    d) Tree


📥 Section 4: Queues — 13 MCQs

  1. Queue follows which principle?
    a) LIFO
    b) FIFO ✅
    c) FILO
    d) Random

  2. Which operation inserts element into queue?
    a) delete()
    b) enqueue() ✅
    c) pop()
    d) push()

  3. Which operation removes element from queue?
    a) push()
    b) delete()
    c) dequeue() ✅
    d) insert()

  4. Front of the queue refers to:
    a) Last element
    b) First inserted element ✅
    c) Top
    d) Bottom

  5. Which queue handles priorities?
    a) Simple Queue
    b) Circular Queue
    c) Double-ended Queue
    d) Priority Queue ✅

  6. Which of the following is not a type of queue?
    a) Circular Queue
    b) Deque
    c) Priority Queue
    d) Hash Queue ✅

  7. Queue is best used in:
    a) Call center systems ✅
    b) Undo feature
    c) Backtracking
    d) Memory management

  8. Time complexity of enqueue and dequeue operations:
    a) O(n)
    b) O(1) ✅
    c) O(log n)
    d) O(n²)

  9. In circular queue, rear is incremented by:
    a) rear++
    b) (rear + 1) % size ✅
    c) rear--
    d) front + 1

  10. Double-ended queue (Deque) allows insertion and deletion:
    a) Only at front
    b) Only at rear
    c) From both ends ✅
    d) None

  11. Queue overflow occurs when:
    a) Queue is empty
    b) Queue is full ✅
    c) Front == Rear
    d) None

  12. Which operation is used to check first element in queue?
    a) pop()
    b) peek() ✅
    c) front()
    d) top()

  13. Real-life example of queue:
    a) Stack of books
    b) Browser history
    c) Ticket line ✅
    d) Function calls

No comments:

Post a Comment

यह रहे डेटा स्ट्रक्चर (Data Structures) के महत्वपूर्ण टॉपिक्स — Arrays (1D/2D), Linked Lists, Stacks, और Queues — पर आधारित 50 महत्वपूर्ण MCQs (with answers):

 यह रहे डेटा स्ट्रक्चर (Data Structures) के महत्वपूर्ण टॉपिक्स — Arrays (1D/2D), Linked Lists, Stacks, और Queues — पर आधारित 50 महत्वपूर्ण...