Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations

CUET Previous Year Questions (PYQs)

CUET Data Structures PYQ


CUET PYQ
Which of the following is not an application of DFS?





Go to Discussion

CUET Previous Year PYQ CUET CUET 2025 PYQ

Solution

  • Topological Sort → Can be done using DFS (by finishing times). ✅

  • Strongly Connected Components (SCCs) → Kosaraju’s and Tarjan’s algorithms use DFS. ✅

  • Solving Maze Problem → DFS is a valid approach to explore paths in a maze. ✅

  • Finding minimum distance in an unweighted graph → This requires Breadth First Search (BFS), not DFS, because BFS ensures the shortest path in an unweighted graph. ❌


CUET PYQ
In a binary search tree, the worst case time complexity of inserting and deleting a key is:





Go to Discussion

CUET Previous Year PYQ CUET CUET 2025 PYQ

Solution

Insertion: To insert, we first locate the correct position. This requires searching the tree = height \(h\). Worst case: tree is skewed (\(h=n\)) → \(O(n)\).

Deletion: To delete, we also search for the node (\(O(h)\)) and adjust pointers (constant). Worst case: \(h=n\). So, time = \(O(n)\).

✅ Therefore: \[ \text{Insertion: } O(n), \quad \text{Deletion: } O(n) \]

CUET PYQ
In __________the search time is independent of the number of elements n.





Go to Discussion

CUET Previous Year PYQ CUET CUET 2025 PYQ

Solution

We need to find the search method where the search time is independent of the number of elements \(n\).

Binary Search: Time complexity \(O(\log n)\). Depends on \(n\). ❌
Hashing: Average case \(O(1)\). Independent of \(n\) (worst case \(O(n)\)). ✅
Linear Search: Time complexity \(O(n)\). Depends on \(n\). ❌
Jump Search: Time complexity \(O(\sqrt{n})\). Depends on \(n\). ❌

Therefore: \[ \text{Correct Answer: Hashing (Option 2).} \]

CUET PYQ
The statements of pseudocode for searching the first element with key k in the linked list L are given below. 
Arrange them in the correct order. 

(A) while (x!=NIL and x.key != k) 

(B) x=L.head 

(C) x=x.next 

(D) return x 

Choose the correct answer from the options given below: 





Go to Discussion

CUET Previous Year PYQ CUET CUET 2025 PYQ

Solution

Given statements:
(A) \(\; \text{while }(x \neq NIL \;\wedge\; x.key \neq k)\)
(B) \(\; x = L.head\)
(C) \(\; x = x.next\)
(D) \(\; \text{return } x\)

Correct order:
1. Initialize pointer: \((B)\) → \(x = L.head\)
2. Loop until end or key found: \((A)\) → \(\text{while}(x \neq NIL \;\wedge\; x.key \neq k)\)
3. Move to next node: \((C)\) → \(x = x.next\)
4. Return result: \((D)\) → \(\text{return }x\)

✅ Therefore, the correct sequence is: \[ (B), (A), (C), (D) \]

CUET PYQ
Arrange the following time complexities in increasing order.
(A). Bubble sort (worst case) 

(B). Deleting head node in singly linked list 

(C). Binary search 

(D). Worst case of merge sort 

Choose the correct answer from the options given below: 
1. (A), (B), (C), (D) 
2. (B), (C), (D), (A) 
3. (B), (A), (D), (C) 
4. (C), (B), (D), (A)





Go to Discussion

CUET Previous Year PYQ CUET CUET 2025 PYQ

Solution

Step 1: Note the time complexities
(A) Bubble Sort (worst case): \(O(n^2)\)
(B) Deleting head node in singly linked list: \(O(1)\)
(C) Binary Search: \(O(\log n)\)
(D) Merge Sort (worst case): \(O(n \log n)\)

Step 2: Arrange in increasing order
\[ O(1)\;<\;O(\log n)\;<\;O(n \log n)\;<\;O(n^2) \] So: \[ (B)\;<\;(C)\;<\;(D)\;<\;(A) \]

CUET PYQ
The Quicksort and randomized Quicksort procedures differ in: 
1. Selection of Pivot element 
2. Worst case time complexity 
3. Best case time Complexity 
4. Final Output





Go to Discussion

CUET Previous Year PYQ CUET CUET 2025 PYQ

Solution

The difference between Quicksort and Randomized Quicksort lies mainly in the way the pivot element is chosen. Let’s analyze each option:

  1. Selection of Pivot element ✅

    • Quicksort: Pivot is chosen deterministically (e.g., always first element, last element, or middle element).

    • Randomized Quicksort: Pivot is chosen randomly (uniformly among available elements).
      → This is the key difference.

  2. Worst case time complexity ❌

    • For both, the worst case is still O(n²).

    • Randomization only reduces the chance of hitting the worst case often, but it does not eliminate it.

  3. Best case time Complexity ❌

    • Both have the same best case: O(n log n) (when pivot splits the array evenly).

    • Randomization doesn’t change the best case.

  4. Final Output ❌

    • Both produce the same sorted output.

    • Randomization only affects the process, not the final result.


CUET PYQ
In case of Binary search tree which of the following procedure's running time is distinct among all 

1. TREE-SUCCESSOR (finds successor of the given node) 
2. TREE-MAXIMUM (finds the node with maximum value) 
3. INORDER- WALK (prints all elements of a tree in inorder manner) 
4. TREE-MINIMUM (finds the node with minimum value)





Go to Discussion

CUET Previous Year PYQ CUET CUET 2025 PYQ

Solution

BST Procedure Time Complexities (MathJax):

  • 1. TREE-SUCCESSOR: \( O(h) \)
  • 2. TREE-MAXIMUM: \( O(h) \)
  • 4. TREE-MINIMUM: \( O(h) \)
  • 3. INORDER-WALK: \( \Theta(n) \)

Since \(O(h)\) differs from \( \Theta(n) \) and INORDER-WALK always visits all \(n\) nodes,

\[ \boxed{\text{Distinct running time: INORDER-WALK (Option 3)}} \]


CUET PYQ
Match List-I with List-II
 List-I List-II
 (Algorithm/ Application) (Data Structure Used)
 (A). BFS (1). Stack
 (B). DFS (II). B Trees
 (C). Heap sort (III). Priority Queue
 (D). Storage on secondary storages devices (IV). Queue
Choose the correct answer from the options given below:

1. (A) - (IV), (B)-(I), (C)-(III), (D) - (II) 
2. (A)-(I), (B)-(III), (C)-(II), (D-(IV) 
3. (A)-(I), (B)-(II), (C) - (IV), (D) (III) 
4.(A)-(II), (B)-(IV), (C)-(I) (D)-(II)





Go to Discussion

CUET Previous Year PYQ CUET CUET 2025 PYQ

Solution

Match the pairs:

  • (A) BFS → Queue (IV)

  • (B) DFS → Stack (I)

  • (C) Heap Sort → Priority Queue (III)

  • (D) Storage on secondary storage devices → B-Trees (II)


CUET PYQ
Given the index i of a node in a heap, we can not compute: 
1. Parent () 
2. Heap size 
3. Left (i) 
4. Right (i)





Go to Discussion

CUET Previous Year PYQ CUET CUET 2025 PYQ

Solution

In a binary heap (array representation):

Parent(i) = \(\left\lfloor \tfrac{i}{2} \right\rfloor\),   Left(i) = \(2i\),   Right(i) = \(2i+1\)

All three can be computed directly from the index i.

But the heap size depends on the total number of elements \((n)\), which cannot be determined from i alone.

\(\therefore\) Correct Answer: (2) Heap size


CUET PYQ
All the elements that hash to the same slot are placed into the same linked list in : 
1. Universal hashing 
2. Linear Probing 
3. Quadratic probing 
4. Chaining





Go to Discussion

CUET Previous Year PYQ CUET CUET 2025 PYQ

Solution

  • Linear Probing → collisions resolved by moving sequentially to next free slot.

  • Quadratic Probing → collisions resolved by quadratic jumps.

  • Universal Hashing → refers to a family of hash functions, not directly a collision handling method.

  • Chaining → collisions are handled by storing all elements in the same slot using a linked list (or another secondary structure).


  • CUET PYQ
    Match List-I with List-II
     List-I List-II
     (Algorithm) (Recurrence relation)
    (A).Binary Search(I).  $T(n)=T(n/2)+c$ (where c is a constant)
     (B).Merge Sort (II). $T(n)=2T(n/2)+\Theta(n)$
     (C). Quick sort (worst case partitioning) (III). $T(n)=T(n-1)+\Theta$ (n)
     (D). Linear Search (IV). $T(n)=T(n-1)+c$ (where c is a constant)
    Choose the correct answer from the options given below:
    1. . (A) (I), (B) (II), (C) - (III), (D) - (IV)
    2.  (A) - (I), (B) - (III), (C) - (II), (D) - (IV)
    3.  (A) - (I), (B) - (II), (C)-(IV), (D)-III 
    4. (A) (III), (B) - (IV), (C) - (I), (D) - (II)





    Go to Discussion

    CUET Previous Year PYQ CUET CUET 2025 PYQ

    Solution

    Binary Search → $T(n)=T(n/2)+c$ → (I)
    - Merge Sort → $T(n)=2T(n/2)+\Theta(n)$ → (II)
    - Quick Sort (worst case) → $T(n)=T(n-1)+\Theta(n)$ → (III)
    - Linear Search → $T(n)=T(n-1)+c$ → (IV)

    Correct Answer: Option (1)

    CUET PYQ
    Which of the following statements are TRUE, where |E| represents the number of edges. 

    (A). In case of a directed graph, the sum of lengths of all the adjacency list is E 

    (B). For an undirected graph, the sum of the lengths of all the adjacency list is 2|E| 

    (C). For a dense graph, adjacency matrix representation is preferable 

    (D). The memory requirement of the adjacency matrix of a graph is dependent on the number of edges 

    Choose the correct answer from the options given below:
    1. (A), (B) and (D) only 
    2. (A), (B) and (C) only 
    3. (A), (B), (C) and (D) 
    4. (B), (C) and (D) only





    Go to Discussion

    CUET Previous Year PYQ CUET CUET 2025 PYQ

    Solution

    - (A) ✅ True: In a directed graph, each edge appears once in exactly one adjacency list ⇒ total length = \(|E|\).
    - (B) ✅ True: In an undirected graph, each edge appears twice (both endpoints) ⇒ total length = \(2|E|\).
    - (C) ✅ True: For dense graphs \((|E| \approx \Theta(V^2))\), adjacency matrix is preferable (fast \(O(1)\) lookups, storage \(O(V^2)\)).
    - (D) ❌ False: Adjacency matrix memory depends only on \(V^2\), not on \(|E|\).

    Final Answer: Option (2) — (A), (B) and (C) only

    CUET PYQ
    Consider implementation of database. Among the following options, choose the most appropriate data structure for this





    Go to Discussion

    CUET Previous Year PYQ CUET CUET 2024 PYQ

    Solution

    When implementing a database, the most appropriate data structure depends on what part of the database you’re focusing on. Among common options, the standard and most suitable choice is:

    B-Tree (or B+ Tree)

    • Used by almost all modern databases (MySQL, PostgreSQL, Oracle, etc.) to implement indexes.

    • Provides efficient search, insert, delete, and range queries in O(log n) time.

    • Optimized for disk storage and block reads, making it ideal for large datasets.


    Other data structures used in databases:

    1. Hash Tables

      • Used for hash indexes and quick equality lookups (e.g., WHERE id = 100).

      • Very fast for exact matches but not good for range queries.

    2. Heaps

      • Used to store unsorted table data.

      • Simple structure but inefficient for searches without indexes.

    3. Linked Lists

      • Used internally for things like transaction logs and some in-memory structures.

    4. Trie / Radix Trees

      • Sometimes used for full-text search or prefix matching.


    CUET PYQ
    Each node is having a successor node in ________________:





    Go to Discussion

    CUET Previous Year PYQ CUET CUET 2024 PYQ

    Solution

    Each node is having a successor node in a Linked List.

    • In a linked list, every node contains data and a pointer (or reference) to its successor node (the next node in the sequence).

    • The last node points to NULL (in a singly linked list) or back to the head (in a circular linked list).


    CUET PYQ
    Consider a completely skewed (left / right) binary search tree with n elements. What is the worst case time complexity of searching an element in this tree?





    Go to Discussion

    CUET Previous Year PYQ CUET CUET 2024 PYQ

    Solution

    A completely skewed BST (all nodes on one side) has height \(n\). Searching may traverse every node in the worst case.

    Worst-case time complexity: \(O(n)\)


    CUET PYQ
    If we want to find last node of a singly linked list then the correct coding is





    Go to Discussion

    CUET Previous Year PYQ CUET CUET 2024 PYQ

    Solution

    To find the last node of a singly linked list, we must keep moving until the link (next pointer) becomes NULL. This ensures we stop exactly at the last node.

    
    // Structure of node
    struct Node {
        int data;
        struct Node* link;
    };
    
    // Function to get last node
    struct Node* getLastNode(struct Node* head) {
        struct Node* temp = head;
    
        // Traverse until last node
        while (temp -> link != NULL) {
            temp = temp -> link;
        }
    
        return temp;  // Now temp points to last node
    }
      

    Explanation:

    • Initialize a pointer temp with head.
    • Keep moving forward using temp = temp → link while temp → link != NULL.
    • When loop ends, temp is pointing to the last node.

    Correct Code Logic: while (temp → link != NULL) temp = temp → link;


    CUET PYQ
    Which of the following is correct? 
    (A) In directed graph sum of length of all adjacency list is $|E|$ 
    (B) The adjacency matrix requires $O(V^2)$ memory 
    (C) In an undirected graph the sum of length of all adjacency list is $|E|$ 
    (D) The memory requirement of adjacency list depends on number of edges in graph 

    (a) A, B, C 
    (b) B, C, D 
    (c) A, B, D 
    (d) A, C, D





    Go to Discussion

    CUET Previous Year PYQ CUET CUET MCA 2026 PYQ

    Solution


    CUET PYQ
    Matching
    Column A Column B
    A. BFS I. Shortest Path
    B. Sparse graph II. Adjacency list representation
    C. Collision Resolution III. Open Addressing
    D. Link list IV. Self Referential structure
    Options 

    (a) (A)-I, (B)-II, (C)-III, (D)-IV 
    (b) (A)-I, (B)-II, (C)-IV, (D)-III 
    (c) (A)-II, (B)-I, (C)-III, (D)-IV 
    (d) (A)-IV, (B)-III, (C)-II, (D)-I





    Go to Discussion

    CUET Previous Year PYQ CUET CUET MCA 2026 PYQ

    Solution


    CUET PYQ
    Consider procedure list search (L, K) to find the first element with key K in list L by simple linear search, returning pointer to its element. Arrange the correct order. 
    (A) $x = L.Head$ 
    (B) while $x \ne Nil$ and $x.key \ne K$ 
    (C) return $x$ 
    (D) $x = x.next$ 

    Options 
    (a) A, B, D, C 
    (b) B, C, D, A 
    (c) A, D, B, C 
    (d) A, B, C, D





    Go to Discussion

    CUET Previous Year PYQ CUET CUET MCA 2026 PYQ

    Solution


    CUET PYQ
    Arrange the following in the increasing order of their asympotic complexities:
    (A) Insertion sort (best case)  
    (B) Bubble sort (worst case) 
    (C) Binary Search (worst case)
    (D) Merge sort (worst case)





    Go to Discussion

    CUET Previous Year PYQ CUET CUET 2024 PYQ

    Solution


    CUET PYQ
    Tree used to represent arithmetic expression is called ______ tree. 
    (a) Threaded 
    (b) Game 
    (c) Red - Black 
    (d) Expression





    Go to Discussion

    CUET Previous Year PYQ CUET CUET MCA 2026 PYQ

    Solution


    CUET PYQ
    Arrange the following in increasing time complexity. 
    (A) Linear search worst case 
    (B) Binary search best case 
    (C) Quick sort expected running time 
    (D) Bubble sort worst case 

    (a) B, A, C, D 
    (b) C, B, A, D 
    (c) D, E, A, C 
    (d) B, D, C, E





    Go to Discussion

    CUET Previous Year PYQ CUET CUET MCA 2026 PYQ

    Solution


    CUET PYQ
    In ______ linked list the last node’s link field points to the first node of list. 
    (a) Circular 
    (b) Linear 
    (c) Sequential 
    (d) Indexed





    Go to Discussion

    CUET Previous Year PYQ CUET CUET MCA 2026 PYQ

    Solution


    CUET PYQ
    The following integers are needed to be stored in ascending order using bubble sort.
    5, 8, 22, 18, 1
    Following are the results of various passes during the sorting process.





    Go to Discussion

    CUET Previous Year PYQ CUET CUET 2024 PYQ

    Solution


    CUET PYQ
    In ______ search we begin search at starting node and when we come across dead end then we backtrack. 
    (a) connected 
    (b) bubble 
    (c) breadth first 
    (d) depth first





    Go to Discussion

    CUET Previous Year PYQ CUET CUET MCA 2026 PYQ

    Solution


    CUET PYQ
    What are the ways to implement a priority Queue?
    (A) Arrays 
    (B) Fibonacci tree 
    (C) Heap Data Structure 
    (D) Linked list

    Choose the correct answer from the options given below:





    Go to Discussion

    CUET Previous Year PYQ CUET CUET 2024 PYQ

    Solution

    Ways to Implement a Priority Queue

    The correct answer is:

    (A) Arrays, (C) Heap Data Structure, and (D) Linked List

    Explanation:

    • Arrays:
      • Unsorted Array: Insertion is O(1), Deletion is O(n).
      • Sorted Array: Insertion is O(n), Deletion is O(1).
    • Heap Data Structure:
      • Binary heaps are commonly used for efficient implementation.
      • Insertion and Deletion take O(log n) time.
    • Linked List:
      • Can be implemented as sorted or unsorted.
      • Efficiency depends on the choice of implementation.

    Why not Fibonacci Tree?

    Fibonacci trees are not used directly for priority queues. However, Fibonacci heaps (a separate data structure) can implement priority queues efficiently.


    CUET PYQ
    Match List – I with List – II
     List - I (Algorithms) List - II (Complexity)
     (A) Bellman - Ford algorithm (with adjacencylist representation)  (I) $O(|V|^2)$
    (B) Dijkstra Algorithm   (II) O((V+E) logV)
    (C) Prim’s Algorithm  (III) O(mn)
    (D) Topological sorting (with adjacency list representation)  (IV) O(m+n)
    Choose the correct answer from the options given below:





    Go to Discussion

    CUET Previous Year PYQ CUET CUET 2024 PYQ

    Solution


    CUET PYQ
    Which of the following is not an applicaiton of Stack?





    Go to Discussion

    CUET Previous Year PYQ CUET CUET 2024 PYQ

    Solution


    CUET PYQ

    Assertion: Binary search tree property allow to print all keys in binary search tree in sorted order by simple recursive algorithm called inorder tree walk.

    Reason: The inorder tree walk algorithm print the key root of subtree between printing value in its left subtree and printing those in its right subtree.

    Options:

    (a) Assertion is true, Reason is true, and Reason is the correct explanation of the Assertion.

    (b) Assertion is true, Reason is true, but Reason is not the correct explanation of the Assertion.

    (c) Assertion is true, but Reason is false.

    (d) Assertion is false, but Reason is true.






    Go to Discussion

    CUET Previous Year PYQ CUET CUET MCA 2026 PYQ

    Solution

    In a Binary Search Tree (BST), all keys in the left subtree are smaller than the root and all keys in the right subtree are larger than the root.

    Inorder traversal follows the order:
    Left Subtree → Root → Right Subtree

    Because of the BST property, this traversal prints the elements in sorted order.

    The reason correctly explains the inorder traversal process where the root is printed between its left and right subtree.

    Correct Answer: (a) Assertion is true, Reason is true, and Reason is the correct explanation of the Assertion.


    CUET PYQ
    Column AColumn B
    (A) Minimum Spanning TreeI. Height balanced
    (B) Topological SortII. Stack
    (C) RecursionIII. Kruskal's algorithm
    (D) AVL TreeIV. DFS

    Options:

    (a) (A)-I, (B)-II, (C)-III, (D)-IV

    (b) (A)-II, (B)-I, (C)-III, (D)-IV

    (c) (A)-IV, (B)-III, (C)-II, (D)-I

    (d) (A)-III, (B)-IV, (C)-II, (D)-I






    Go to Discussion

    CUET Previous Year PYQ CUET CUET MCA 2026 PYQ

    Solution

    Minimum Spanning Tree → Kruskal's algorithm → III
    Topological Sort → DFS based algorithm → IV
    Recursion → uses stack → II
    AVL Tree → height balanced tree → I

    Correct Answer: (d) (A)-III, (B)-IV, (C)-II, (D)-I


    CUET PYQ
    Consider the following tree. This is a / a _________________





    Go to Discussion

    CUET Previous Year PYQ CUET CUET 2024 PYQ

    Solution


    CUET PYQ
    Which algorithm have same order of complexity

    A. Deletion from Queue

    B. Worst case search in binary search tree

    C. Insertion in stack

    D. Quick sort worst case

    Options:

    (a) C, D

    (b) A, C

    (c) A, B

    (d) B, C






    Go to Discussion

    CUET Previous Year PYQ CUET CUET MCA 2026 PYQ

    Solution

    Deletion from Queue → O(1)
    Worst case search in Binary Search Tree → O(n)
    Insertion in Stack → O(1)
    Quick Sort worst case → O(n2)

    Same order complexity:
    Deletion from Queue and Insertion in Stack → O(1)

    Correct Answer: (b) A, C


    CUET PYQ

    Length or number of data element of Array can be obtained from index set by which of the following formulae.

    (a) Lower bound − Upper bound − 1

    (b) Lower bound − Upper bound + 1

    (c) Upper bound − Lower bound + 1

    (d) Upper bound + Lower bound − 1






    Go to Discussion

    CUET Previous Year PYQ CUET CUET MCA 2026 PYQ

    Solution

    Number of elements in an array is calculated using:

    Length = Upper Bound − Lower Bound + 1

    Example:
    If Lower Bound = 0 and Upper Bound = 9

    Length = 9 − 0 + 1 = 10

    Correct Answer: (c) Upper bound − Lower bound + 1


    CUET PYQ

    Which of the following is not an application of stack.

    (a) Tower of Hanoi

    (b) evaluation of postfix expression

    (c) Priority queue

    (d) Recursion






    Go to Discussion

    CUET Previous Year PYQ CUET CUET MCA 2026 PYQ

    Solution

    Tower of Hanoi → solved using recursion and stack concept
    Evaluation of postfix expression → uses stack
    Recursion → implemented using call stack

    Priority queue is implemented using heap or special queue structure, not stack.

    Correct Answer: (c) Priority queue



    CUET


    Online Test Series,
    Information About Examination,
    Syllabus, Notification
    and More.

    Click Here to
    View More

    CUET


    Online Test Series,
    Information About Examination,
    Syllabus, Notification
    and More.

    Click Here to
    View More

    Limited Seats
    × Aspire MCA Promotion

    Game Changer NIMCET Test Series 2026

    Boost your preparation with mock tests, analysis and rank-focused practice.

    JOIN NOW
    Ask Your Question or Put Your Review.

    loading...