Question Paper Code : 30038
B.E./B.Tech. DEGREE EXAMINATIONS, APRIL/MAY 2026.
Second Semester
All Branches
CS 25C05 — DATA STRUCTURES USING C++
(Common to : )
(Regulations 2025)
Answer ALL questions.
PART A — (10 × 1 + 10 × 3 = 40 marks)
- 1.
Which variable provides an alias name to an existing variable?
- (A)Pointer
- (B)Static Variable
- (C)Reference Variable
- (D)Constant Variable
CO1 · BL1
- 2.
Which keyword is used to allocate memory dynamically in C++?
- (A)Malloc
- (B)Alloc
- (C)New
- (D)Create
CO1 · BL1
- 3.
The class whose members are inherited is called:
- (A)Parent class
- (B)Base Class
- (C)Child class
- (D)Both (A) and (B)
CO2 · BL1
- 4.
Which keyword is used for runtime polymorphism?
- (A)Class
- (B)Friend
- (C)Virtual
- (D)Static
CO2 · BL1
- 5.
The operation of inserting an element into stack is called:
- (A)Pop
- (B)Push
- (C)Insert
- (D)Add
CO3 · BL1
- 6.
Polynomial addition using linked list is efficient because:
- (A)Uses recursion only
- (B)Dynamic memory allocation
- (C)Requires fixed size memory
- (D)No memory needed
CO3 · BL2
- 7.
Right child of node at index i in array representation is:
- (A)2i
- (B)2i + 1
- (C)i + 1
- (D)i/2
CO4 · BL2
- 8.
In a binary tree, each node can have atmost:
- (A)1 child
- (B)2 children
- (C)3 children
- (D)Unlimited children
CO4 · BL1
- 9.
Number of comparisons in worst case of Linear Search for n elements is:
- (A)1
- (B)log n
- (C)n
- (D)n²
CO5 · BL3
- 10.
If an array has 1024 sorted elements, maximum comparisons in Binary Search are :
- (A)10
- (B)11
- (C)512
- (D)1024
CO5 · BL3
- 11.
Differentiate between the constructor and destructor in C++.
CO1 · BL2
- 12.
How are class members accessed in C++?
CO1 · BL1
- 13.
Define base class and derived class with an example.
CO2 · BL2
- 14.
What is a pure virtual function? Give syntax.
CO2 · BL1
- 15.
Define Omega (Ω) notation with an example.
CO3 · BL2
- 16.
How can a stack be implemented using linked list?
CO3 · BL3
- 17.
List the properties of a binary tree.
CO4 · BL1
- 18.
Differentiate between directed graph and undirected graph.
CO4 · BL4
- 19.
State the best case and worst-case time complexity of Linear Search.
CO5 · BL1
- 20.
Which sorting algorithm is suitable for small datasets? Why?
CO5 · BL5
PART B — (5 × 12 = 60 marks)
- 21.(a)
Explain the structures and classes in C++. Compare structures and classes with examples.
CO1 · BL4
- Or
- (b)
Explain function overloading and operator overloading in C++. Write a C++ program to overload any one operator.
CO1 · BL6
- 22.(a)
What are virtual functions? Explain their role in dynamic binding with a suitable example.
CO2 · BL3
- Or
- (b)
Differentiate between composition and inheritance. Explain with real-time examples.
CO2 · BL4
- 23.(a)
Write an algorithm to convert an infix expression into postfix expression. Convert the expression. (A + B) * (C − D) / E
CO3 · BL6
- Or
- (b)
Analyze the time complexity of stack, queue, array access, and linked list insertion operations using Big-Oh notation.
CO3 · BL4
- 24.(a)
Compare adjacency matrix and adjacency list for a graph with 1000 vertices and 1500 edges. Determine which representation is memory efficient and justify with calculations.
CO4 · BL5
- Or
- (b)
Construct a binary tree from the following traversals and perform all traversals again: In order : H D I B E A F C G; Preorder : A B D H I E C F G. Find the height and number of leaf nodes.
CO4 · BL6
- 25.(a)
Write the Merge Sort algorithm and explain the divide and conquer approach with an example.
CO5 · BL6
- Or
- (b)
Explain Heap Sort algorithm with suitable example. Show heap construction and sorting steps.
CO5 · BL3