JNTU
JNTU B.Tech III DATA STRUCTURES Previous Question Paper (August-2022 - R16)
Answer any five questions. All questions carry equal marks.
Main
Explain representation of arrays along with their advantages and disadvantages.
Answer
An array is a collection of elements of the same data type stored in contiguous memory locations. Each element is identified by at least one array index or key. In memory, the address of any element can be calculated using the base address and the index:
Advantages:
- Provides constant time access (O(1)) to any element given its index.
- Efficient for storing fixed-size data sets.
- Better cache locality due to contiguous memory allocation.
Disadvantages:
- Fixed size: The capacity must be known at compile time, leading to potential memory wastage or overflow.
- Insertion and deletion are expensive (O(n)) as they require shifting elements to maintain contiguity.
Define data structure. Explain different types of data structure.
Answer
A data structure is a specialized format for organizing, processing, retrieving, and storing data in a computer so that it can be accessed and modified efficiently. It defines the relationship between data and the operations that can be performed on them.
Data structures are broadly classified into two types:
- Linear Data Structures: Elements are arranged in a sequential or linear order where each element is attached to its previous and next adjacent elements. Examples include Arrays, Linked Lists, Stacks, and Queues.
- Non-Linear Data Structures: Elements are not arranged sequentially; they are organized in a hierarchical or interconnected manner. Data elements can be traversed in multiple ways. Examples include Trees (hierarchical) and Graphs (network-based).
Discuss Briefly about Recursive algorithms.
Answer
Sign in to view the complete answer paper.
Write a note on time complexity and space complexity with an example.
Answer
Sign in to view the complete answer paper.
Write a program to implement the operation of queue by using linked list.
Answer
Sign in to view the complete answer paper.
Discuss infix to prefix conversion algorithm using stack with an example.
Answer
Sign in to view the complete answer paper.
Explain the procedure to evaluate postfix expression 6 2 3 + - 3 8 2 / + * 2 4 3 +.
Answer
Sign in to view the complete answer paper.
Explain basic operations of Deque with an example.
Answer
Sign in to view the complete answer paper.
Explain binary tree ADT.
Answer
Sign in to view the complete answer paper.
Discuss representation of binary tree using arrays and linked list.
Answer
Sign in to view the complete answer paper.
Define a Max Heap. Construct a max heap for the following: {12, 15, 9, 8, 10, 18, 7, 20, 25}.
Answer
Sign in to view the complete answer paper.
What is a graph? Explain various representations of graphs.
Answer
Sign in to view the complete answer paper.
Give an algorithm for quick sort and explain its time complexity. Trace the algorithm for the following data: 65 70 75 80 85 60 55 50 45.
Answer
Sign in to view the complete answer paper.
Arrange the following list of elements in ascending order using Merge Sort A, L, G, O, R, I, T, H, M, S. Clearly show the sorting process at each step.
Answer
Sign in to view the complete answer paper.
Write an algorithm of KMP.
Answer
Sign in to view the complete answer paper.
Write about Splay Trees with an example.
Answer
Sign in to view the complete answer paper.