0 ratings 0% found this document useful (0 votes) 26 views 29 pages DDS Objectives (MS)
The document covers various topics related to data structures, including multiple choice questions, fill-in-the-blanks, and one-word answer questions on data structures such as stacks, recursion, and queues. It provides a comprehensive set of questions designed to test knowledge on key concepts, operations, and characteristics of these data structures. The content is structured for exam preparation, ensuring clarity and readiness for assessments.
AI-enhanced title and description
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Go to previous items Go to next items
Save DDS OBJECTIVES (MS) For Later §) Topic 1: Introduction to Data
Structures
Includes:
20 MCQs
20 Fill in the Blanks
20 One Word Answer Questions
(All simple, clear, and exam-ready)
20 MCQs (Multiple Choice Questions)
1. Which of the following is a linear data structure?
a) Tree
b) Graph
©) Array
d) Heap
+. ©) Array
2. Which structure uses LIFO?
a) Queue
b) Stack
©) Array
d) Linked List
~ b) Stack
3. Which structure follows FIFO?
a) Tree
b) Queue
©) Stack
d) Heap
> b) Queue
4. Arrays are best suited for:
a) Dynamic memory allocation
b) Insertion at beginning
c) Fast access using index
d) Searching in sorted data
. ¢) Fast access using index10.
. Which is nota linear data structure?
a) Linked List
b) Stack
©) Tree
d) Queue
. ¢) Tree
. A queue works on which principle?
a) LIFO
b) FIFO
c) FILO
d) None
-. b) FIFO
. The term ‘ADT’ stands for:
a) Advanced Data Tree
b) Abstract Data Type
©) Array Data Tree
d) Abstract Data Table
_. b) Abstract Data Type
. Which structure is used to implement function calls?
a) Stack
b) Queue
©) Array
d) Tree
-- a) Stack
. In an array, elements are stored in:
a) Linked fashion
b) Random memory
c) Contiguous memory
d) Non-contiguous memory
-. ¢) Contiguous memory
Which is best for hierarchical data?
a) Array
b) Stack
c) Tree
d) Graph
_. ¢) Tree11.
12.
13.
14.
15.
16.
Which of the following is not a characteristic of array?
a) Random access
b) Fixed size
c) Dynamic memory
d) Contiguous storage
_. ¢) Dynamic memory
Which structure allows insertion and deletion at both ends?
a) Stack
b) Queue
c) Deque
d) Array
» ¢) Deque
A dynamic data structure grows by
a) Declaring size beforehand
b) Manual reallocation
c) System-managed memory
d) Recursion
. ¢) System-managed memory
Which is better for memory efficiency?
a) Array
b) Linked List
c) Queue
d) Stack
. b) Linked List
Which data structure is used in recursion?
a) Stack
b) Queue
©) Tree
d) Heap
~- a) Stack
Graph is a:
a) Linear data structure
b) Hierarchical structure
c) Non-linear data structure
d) None of the above
_. ¢) Non-linear data structure17. Data structures are used for:
a) Storage
b) Organization
c) Processing
d) All of the above
-- d) All of the above
18. A data structure that contains a collection of elements, each pointing to the next is:
a) Array
b) Stack
c) Queue
d) Linked List
-- d) Linked List
19. What is a major disadvantage of arrays?
a) Random access
b) Fixed size
c) Fast search
d) Dynamic resizing
—. b) Fixed size
20. Which data structure is used for undo operations?
a) Queue
b) Array
) Stack
d) Tree
-. ¢) Stack
20 Fill in the Blanks
1A data structure arranges elements in sequence.
— linear
2, _____ structures allow branching between elements.
— Non-linear
3. Anarray stores data in _ memory.
- contiguous
4. Astack follows the principle.
— LIFO
5. Aqueue follows the principle
— FIFO20.
data structure is used in function calls.
- Stack
is the process of adding data.
~ Insertion
is the process of removing data.
- Deletion
|. Anarray has _ size after declaration
~ fixed
. The data structure allows dynamic memory usage.
~ Linked List
. Abstract Data Type is abbreviated as —
— ADT
. Ina list, each element points to the next one.
~ linked
__ is a linear structure that allows operations at one end only.
-» Stack
is used for scheduling processes in OS.
~ Queue
. Each data structure has specific and disadvantages
~ advantages
operation is used to add in stack.
~ Push
__ operation is used to remove from queue.
—. Dequeue
. Linked List uses memory allocation.
= dynamic
. Array access time is
- constant / 0(1)
‘Stack overflow occurs when stack is
— fullIB Topic 2: Stack
20 MCQs (Multiple Choice Questions)
1. Which of the following is true about a stack?
a) Follows FIFO
b) Follows LIFO
c) Random Access
d) Circular Access
. b) Follows LIFO
2. What is the operation called to add an element to a stack?
a) Insert
b) Append
©) Push
d) Add
» ¢) Push
3. What is the operation called to remove an element from a stack?
a) Remove
b) Delete
©) Pull
d) Pop
— d) Pop
4, Which of the following operations is not valid on a stack?
a) Push
b) Pop
c) Peek
d) Enqueue
~ d) Enqueue
5. What is the value at the top of the stack called?
a) First Element
b) Bottom Element
©) Top Element
d) Mid Element
— ¢) Top Element
6. Which data structure is used in function calls?
a) Queue
b) Array
c) Stack
d) Tree
-, ¢) Stack. What is the time complexity of push and pop operations in a stack?
a) O(n)
b) o(1)
c) O(log n)
d) O(n log n)
. b) 0(1)
. Which of the following is used to implement recursion in programming?
a) Queue
b) Stack
c) Linked List
d) Tree
. b) Stack
. Which condition indicates stack overflow in an array-based implementation?
a) top ==
b) top == maxSize -1
c) top ==-
d) top == NULL.
— b) top == maxSize - 1
. Stack is also called a list.
a) Random
b) LIFO
c) FIFO
d) Circular
— b) LIFO
. Which function checks the top value without removing it?
a) pop()
b) peek()
c) push()
d) clear()
» b) peek()12.
13.
14.
15.
17.
What does a pop operation return from an empty stack?
a) Error
b)0
c) NULL
d)1
» a) Error
Which of the following is not a reallife example of a stack?
a) Pile of plates
b) Call stack
c) Queue at ticket counter
d) Undo operations in editor
» c) Queue at ticket counter
In a linked list implementation of a stack, where does the push operation occur?
a) End
b) Middle
c) Front (Head)
d) Tail
» ¢) Front (Head)
Which language supports built-in stack data structure?
a)c
b) Python
c) Java
d) All of the above
-. d) All of the above
. Stack underflow occurs when:
a) Stack is full
b) Stack is empty
) Stack overflows
d) Stack has 1 element
- b) Stack is empty
What is the default size of a stack in many C compilers (approx)?
a) 1MB
b) 256 bytes
c) 8MB
d) 64KB
-. c) 8MB18. What kind of memory is used for stack in C?
a) Heap
b) Stack
c) Static
d) Shared
- b) Stack
19. Which of the following uses a stack internally?
a) BFS
b) DFS
c) Merge Sort
4) Dijkstra's Algorithm
-. b) DFS
20. What happens to top pointer after pushing an element?
a) Decrements
b) Increments
c) Resets
d) Stays same
-- b) Increments
20 Fill in the Blanks
1. Stack follows __ order.
+ LIFO
2. The operation to insert an element in a stack is called
— Push
3. The operation to remove an element from a stack is called
-- Pop
4, The _____ operation returns the topmost value without removing it.
-. Peek
5. Stack overflow occurs when the stack is
— Full
6. Stack underflow occurs when the stack is
. Empty
7. In array implementation, stack is maintained using a variable.
— Top
8. Recursive functions use internally.
- Stack
9. Stack is commonly implemented using arrays or
— Linked Lists10.
un
12,
13.
14,
15.
16.
V7.
18.
19.
20.
The undo feature in MS Word uses
- Stack
In linked list stack, push happens at the
—. Head
Stack is also called a__list.
= UFO
Function calls in C are stored in the memory.
- Stack
To clear a stack, we reset the pointer.
- Top
Astack-based memory is In size.
Limited
Stacks are used in parsing.
- Expression
To reverse a string, we can use
- Stack
Stack operations are of constant time, Le,
-- 0(1)
Stack memory is automatically managed during
- Function Calls
Stack is used in depth-first
-- Search
20 One Word Questions
What type of memory does the stack use?
+ Stack
Which principle does stack follow?
-- LIFO
What do you call the last inserted item in a stack?
-. Top
What is the function that removes the top value?
-- Pop
What function adds a new value to the stack?
— Push
What function checks the top value without removing?
-. Peek20.
. What error occurs when you pop from an empty stack?
» Underflow
. What error occurs when stack exceeds its size?
~ Overflow
. Stack is used in what type of search?
— DFS
._ Stack is implemented using which two main methods?
» Array, Linked List
. Inacall stack, what stores return addresses?
— Stack Frames
.. What is the time complexity of push in stack?
» O(1)
. What type of structure is a stack?
» Linear
. In linked list stack, what pointer is updated after push?
— Head
. What real-life object behaves like a stack?
» Plate
. What is the opposite of push operation?
- Pop
. Which data structure allows only one end insertion and deletion?
~ Stack
. Which algorithm uses stack for evaluation?
» DFS
). Stack used in which kind of parsing?
-. Expression Parsing
What happens when top = -1 in stack?
» Empty1B Topic 3: Recursion
20 MCQs (Multiple Choice Questions)
1. Whats recursion in programming?
a) Looping
b) Function calling itself
c) Pointer usage
d) Memory allocation
- b) Function calling itself
2. Which of the following is essential for recursion?
a) Loop
b) Class
c) Base case
d) Global variable
. ¢) Base case
3. What happens if the base case is missing in recursion?
a) Compilation error
b) Stack overflow
©) Memory leak
4d) Program terminates normally
- b) Stack overflow
4. Which data structure is used in recursion internally?
a) Queue
b) Array
©) Stack
4d) Linked list
. ¢) Stack
5. Inthe factorial function using recursion, what is fact(0) ?
a)O
b)1
2
4d) Undefined
= b)1
6. What does a recursive function do after reaching the base case?
a) Stops
b) Reverses the calls
c) Exits the program
4d) Goes to next loop
— b) Reverses the calls10.
WW.
12.
. What is tail recursion?
a) A recursion where recursive call is at the end
b) A recursion that has no base case
c) A recursion that never ends
d) A type of pointer
~ a) A recursion where recursive call is at the end
.. Which of the following problems can be solved by recursion?
a) Factorial
b) Tower of Hanoi
c) Fibonacci
d) All of these
~ d) Allof these
. Which is more memory efficient in some cases?
a) Iteration
b) Recursion
c) Both same
d) None
~- a) Iteration
What keyword is used in Python for recursion?
a) call
b) def
) return
d) fune
— ¢) return
Recursive functions consume:
a) Queue
b) Stack memory
c) Heap
d) None
. b) Stack memory
Infinite recursion leads to:
a) Compilation error
b) Stack overflow
c) Runtime error
d) Output = 0
. b) Stack overflow13.
14.
15.
16.
17.
18.
What does each recursive call create?
a) Anew variable
b) Anew stack frame
c) Anew pointer
d) Nothing
—. b) Anew stack frame
What is the return type of a recursive function?
a) Always void
b) Same as function return type
c) Integer only
d) String only
b) Same as function return type
What is printed by recur(3) if recur(n): if n>0
a)123
b)321
o)111
d) Error
+ b)321
Recursive functions should always include:
a) Loops
b) Global variable
c) Base condition
d) Class
— ¢) Base condition
Which function call shows recursion?
a) sum(10, 20)
b) print)
©) fact(n) calling fact(n-1)
d) return n
-. ¢) fact(n) callling fact(n-1)
Which of the following is a non-recursive approach?
a) Using loops
b) Function calling itself
c) Stack
d) Queue
_. a) Using loops
print(n); recur(n-1) ?19. In C/C+, recursion is implemented using:
a) Stack
b) Heap
c) Register
d) Queue
-. a) Stack
20. In Java, recursion must be handled carefully to avoid:
a) Memory leak
b) Stack overflow
©) Infinite loops
¢) Compilation error
~ b) Stack overflow
20 Fill in the Blanks
1. Recursion means a funetion calling
~ itself
2. Every recursive function must have a__case.
» base
3. Recursive calls are stored in the _
. stack
4. Infinite recursion leads to
~ stack overflow
5. The factorial of 0 using recursion is
od
6. Arecursive function continues until the ___ case is met.
. base
7. The function call stack is used for storing calls,
~ recursive
8, Recursion is an alternative to using
» loops
9. Recursion is slower than iteration due to overhead.
-. function call
10. Tail recursion helps in optimization.
— compiler
11. The base case prevents recursion.
» infinite12.
13,
14.
15.
16.
7.
18.
19.
20.
Recursive functions use more than iterative ones
— memory
In recursion, each call adds anew to the stack
— frame
The return value Is passed back through the
— call stack
Tower of Hanol is a classic example of z
|. recursion
A recursive function can call functions too.
— other
In Python, a function is defined using the keyword
= def
The recursive call must work toward the case,
— base
Stack memory is a resource in recursion.
~ limited
Too many recursive calls lead to stack .
— overflow
20 One-Word Answer Questions
1
What is recursion?
~. Self-calling
What is needed to stop recursion?
» Base case
What memory is used in recursion?
~ Stack
What happens if base case is missing?
~ Overflow
What type of recursion has call at the end?
- Tail
Which classic problem uses recursion?
— Hanoi
What is fact(0) 7
1
What kind of function is fib(n) where fib(n-1) is used?
— Recursive10.
11.
Te
13.
14.
15.
16.
17.
18.
19.
20.
What returns the final result in recursion?
. Base case
What stores local variables in recursion?
» Stack
Which is better for memory in simple loops?
— Iteration
What data structure supports recursion calls?
— Stack
What do we call one round of function call?
— Frame
What error occurs on infinite recursion?
~ Stack overflow
What language supports recursion?
All
What must decrease in every recursive call?
— Argument
What helps optimize tail recursion?
— Compiler
What defines function in Python?
~ def
Where are return values collected in recursion?
— Stack
What ends the recursive function?
» Base1B Topic 4: Queues
20 MCQs (Multiple Choice Questions)
1. What is the basic principle of a queue?
a) LIFO
b) FIFO
©) FILO
d) LILO
~- b) FIFO
2. Which data structure is used for job scheduling?
a) Stack
b) Queue
c) Tree
d) Graph
- b) Queue
3. What happens when a queue is full and you try to insert?
a) Underflow
b) Overflow
c) Rear set to NULL
d) Front set to-1
- b) Overflow
4, Which of the following is not a type of queue?
a) Linear Queue
b) Circular Queue
) Priority Queue
d) Binary Queue
- d) Binary Queue
5. Ina circular queue, the last position is connected to:
a) Rear
b) Front
c) NULL
d) Middle
- b) Front
6. What is the time complexity of enqueue operation in a queue?
a) O(log n)
b) O(n)
c) 0(1)
d) O(n"2)
- 6) 0(1). Dequeue operation removes an element from:
a) Rear
b) Center
©) Front
d) Any position
- ¢) Front
. Which queue allows insertion and deletion from both ends?
a) Linear Queue
b) Circular Queue
c) Deque
d) Priority Queue
-, ¢) Deque
. Which of these is an application of queues?
a) Browser history
b) Backtracking
c) CPU Scheduling
d) Tree traversal
-. ¢) CPU Scheduling
. Which is true about a priority queue?
a) Insertion is only at front
b) Deletion is only from rear
c) Elements are served based on priority
d) Elements are inserted at random
. ¢) Elements are served based on priority
. What is the rear pointer used for in a queue?
a) To point the front of queue
b) To access memory
c) To add elements
d) To remove elements
-» ¢) To add elements
. Ina linear queue, what happens when the rear reaches the maximum index?
a) Queue overflows
b) Elements shift
c) Front moves
d) Underflow
-. a) Queue overflows13.
14.
16.
17.
18.
In C, a queue can be implemented using:
a) Only arrays
b) Only linked list
©) Arrays and linked list
d) Only structures
-. ¢) Arrays and linked list
Which of the following is not a queue operation?
a) Enqueue
b) Dequeue
c) Peek
d) Push
= d) Push
. What is the main disadvantage of linear queues using arrays?
a) Slow
b) Limited space reuse
c) Infinite loop
d) Cannot dequeue
~ b) Limited space reuse
How many pointers are used in queue Implementation using linked list?
a)1
b)2
°)3
d)4
-. b) 2 (front and rear)
What does a circular queue solve?
a) Overflow
b) Underflow
c) Memory reusability
d) Deletion error
-. ¢) Memory reusability
Which data structure best represents queue behavior?
a) Stack
b) Tree
o) List
d) Array
-. d) Array19. Queue can be used for:
a) Function calls
b) Parsing expressions
) Call center line system
d) Recursion
— €) Call center line system
20. What happens when front = rear in an empty queue?
a) Underflow
b) Overflow
©) Full
d) Nothing
— a) Underflow
& 20 Fill in the Blanks
1. Queue follows the principle.
» FIFO
2. The two main operations of a queue are__ and _.
~ Enqueue, Dequeue
3A
queue allows circular movement,
~ Cireular
4. Queue is a data structure.
— Linear
‘operation removes an element from the front,
-. Dequeue
6. ‘operation inserts an element at the rear.
~ Enqueue
7. In queue, the element inserted first is removed
- First
B.A queue allows both insertions and deletions from both ends.
- Deque
9. A queue overflow happens when the queue is
- Full
10. Priority queue serves elements based on their
~ Priority
11. Linear queue has limited reuse.
_. Memory12.
13,
14,
15.
16,
17.
18.
19,
20.
Circular queue uses structure to improve memory use.
- Ring
Rear pointer is used for in queue
= Insertion
Front pointer is used for in queue.
- Deletion
The queue underflow condition occurs when the queue Is
~ Empty
Queues are widely used in
- CPU
scheduling,
Queue implemented with a linked list uses and
- Front, Rear
__ pointers.
‘queue manages requests with varying priorities.
+ Priority
queue supports both FIFO and LIFO operations.
- Deque
Enqueue operation adds a new item at the end.
» Rear
“ 20 One-Word Answer Questions
1
What is the removal operation in queue?
» Dequeue
What is the insertion operation in queue?
- Enqueue
What type of data structure is a queue?
- Linear
.. What principle does queue follow?
— FIFO
Which queue allows both-end operations?
- Deque
What happens when we remove from an empty queue?
- Underflow
What is the opposite of FIFO?
LIFO
Where is the element inserted in a queue?
. Rear20.
. Where is the element deleted from in a queue?
> Front
. What pointer tracks the first element in queue?
— Front
. What pointer tracks the last element?
» Rear
. What queue type reuses empty spaces?
—» Circular
. What etror occurs if we insert into a full queue?
— Overflow
. Name a queue used in real-time systems?
-. Priority Queue
|. What data structure supports CPU task scheduling?
— Queue
. Which queue does not follow FIFO always?
~ Priority Queue
. What queue connects last and first positions?
~ Circular Queue
. What is a dynamic memory-based queue type?
~ Linked List Queue
|. What queue is used in printers?
— Queue
What kind of queue is used in 0S scheduling?
— Priority Queue1B Topic 5: Linked Lists
20 MCQs (Multiple Choice Questions)
1.
What is the time complexity of inserting an element at the beginning of a singly linked
list?
a) O(n)
b) O(log n)
©) 0(1)
d) O(n log n)
-- ¢) 0(1)
. Which of the following is not a type of linked list?
a) Circular Linked List
b) Doubly Linked List
©) Triply Linked List
d) Singly Linked List
~- ¢) Triply Linked List
. Ina singly linked list, each node contains:
a) Data only
b) Pointer only
c) Data and pointer
d) None
. ¢) Data and pointer
. The last node of a singly linked list contains
a) NULL pointer
b) Self pointer
c) Head pointer
d) Random pointer
- a) NULL pointer
. Ina doubly linked list, each node has:
a) Two pointers
b) One pointer
c) Three pointers
d) No pointer
_. a) Two pointers. Which operation is easiest in a circular linked list?
a) Insertion at end
b) Insertion at beginning
c) Deletion from middle
d) Traversal
~ b) Insertion at beginning
. What is the disadvantage of arrays over linked lists?
a) Fixed size
b) Easy insertion
c) Random access
d) Easy deletion
» a) Fixed size
|. What does the ‘head’ of a linked list refer to?
a) Last node
b) Middle node
©) First node
d) Pointer to NULL
. ¢) First node
. Which is better for implementing stacks and queues?
a) Arrays
b) Linked Lists
c) Hash Tables
d) Sets
~ b) Linked Lists
. Deleting a node from a singly linked list requires:
a) Only current node
b) Previous and current node
c) Current and next node
d) Head only
» b) Previous and current node
. Linked lists are:
a) Static data structure
b) Dynamic data structure
©) Both
d) None
. b) Dynamic data structure13.
14.
15.
16.
17.
.. Traversal of linked list means:
a) Searching an element
b) Modifying an element
c) Visiting each node
d) Sorting
. ¢) Visiting each node
What is the minimum number of nodes in a circular linked list?
a)o
b)1
o)2
d) Infinite
.b)1
Which pointer in a doubly linked list points to the next node?
a) Left
b) Right
c) Forward
d) Next.
— d) Next
Which of the following allows traversal in both directions?
a) Singly Linked List
b) Circular Linked List
c) Doubly Linked List
d) Linear Array
-. ¢) Doubly Linked List
Which data structure has non-contiguous memory allocation?
a) Array
b) Linked List
c) Matrix
d) Graph
-. b) Linked List
Which is a circular singly linked list?
a) Last node points to NULL
b) First node points to last
c) Last node points to first
d) None
— c) Last node points to first18. What does NULL in the linked list signify?
a) End of list
b) Start of list
©) Middle of list
d) Random pointer
» a) End of list
19. In linked list, data is stored in:
a) Nodes
b) Elements
c) Arrays
d) Variables
_. a) Nodes
20. Whatis the head in a linked list?
a) NULL pointer
b) Node that contains data
c) The first node
d) Pointer to last
-» ¢) The first node
& 20 Fill in the Blanks
1. Alinked list is a____data structure.
. dynamic
2. Each node in a linked list contains data and a
- pointer
3. The pointer in the last node of a singly linked list is
» NULL
4. The first node in a linked list is called the .
. head
5. Ina doubly linked list, each node has two pointers: one for the next and one for the
node.
— previous
6. Circular linked list forms a
. loop
7. Insertion at the beginning of a singly linked list is done by changing the
» head
pointer.
8. Deletion in a linked list requires updating the pointer.
|. previous10.
1.
12.
13.
14.
15,
16.
7.
18.
19.
20.
Ina singly linked list, we can only traverse in direction.
~ one
In a doubly linked list, traversal is possible in__ directions.
» two
Memory for nodes in a linked list is allocated using
memory allocation.
» dynamic
NULL is used to indicate the of the list.
— end
A linked list allows traversal from the last node to the first.
= circular
To delete a node from a singly linked list, you need the node
-. previous
Linked list elements are stored in memory locations.
» non-contiguous
The data part of the node stores the
+ value
The pointer part of the node stores the ____ to the next node.
~ address
In a circular linked list, the last node points to the node.
. first
A list where each node has more than two links is called @ linked list.
— multi
The number of elements in a linked list is called its
» length
©, 20 One Word Answer Questions
1
What is the structure used to store a list dynamically?
~ Linked list
What does each node contain?
~ Data and pointer
What points to the next node?
~ Pointer
What is the first node called?
. Head
What marks the end of a list?
. NULL.18.
20.
. What is the opposite of singly linked list?
+ Doubly linked list
. What linked list loops back to the start?
~ Circular linked list
. What type of memory allocation is used?
— Dynamic
. Which node must be known to delete in singly list?
— Previous
. Which list allows backward traversal?
~ Doubly linked list
. What does a circular list form?
- Loop
. What stores non-contiguous elements?
» Linked list
. What structure stores elements in nodes?
~ Linked list
|. What is used to create nodes in C?
— malloc
. What function deallocates nodes?
~ free
. What is the basic unit of a linked list?
~» Node
. What does the head point to in an empty list?
» NULL
What part of node holds value?
+ Data
. What part holds address?
+ Pointer
What is traversal?
-. Visiting each node