JNTU
JNTU B.Tech II DATA STRUCTURES Previous Question Paper (March 2021 - R15)
Answer any five questions. All questions carry equal marks.
Main
Define data structure. Discuss different types of data structures and their application.
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 worked with efficiently. It defines the relationship between the data and the operations that can be performed on the data.
Data structures are broadly classified into two categories:
- Linear Data Structures: Data elements are arranged in a sequential or linear order. Examples include Arrays, Linked Lists, Stacks, and Queues. These are used for applications like implementing function call stacks, task scheduling, and maintaining ordered lists.
- Non-Linear Data Structures: Data elements are arranged in a hierarchical or interconnected manner. Examples include Trees and Graphs. These are used for applications like file system organization, database indexing, and network routing algorithms.
Write an algorithm to insert new node at the beginning and at the end of a Singly Linked List.
Answer
To insert a node into a Singly Linked List, assume a node structure with data and a next pointer.
Algorithm: Insert at Beginning
- Create a new node 'newNode'.
- Set newNode.data = value.
- Set newNode.next = head.
- Set head = newNode.
Algorithm: Insert at End
- Create a new node 'newNode'.
- Set newNode.data = value and newNode.next = null.
- If head is null, set head = newNode and return.
- Initialize temp = head.
- Traverse until temp.next is null: temp = temp.next.
- Set temp.next = newNode.
Explain the procedure to evaluate postfix expression. Evaluate the following Postfix expression 7 3 4 + - 2 4 5 / + * 6 / 7 +.
Answer
Sign in to view the complete answer paper.
Write an algorithm to push and pop an element from linked stack.
Answer
Sign in to view the complete answer paper.
What is a binary tree? Construct a binary tree given the pre-order traversal and in-order traversals as follows:
Pre-Order Traversal: G B Q A C K F P D E R H
In-Order Traversal: Q B K C F A G P E D H R
Answer
Sign in to view the complete answer paper.
What is a graph? Explain the properties of graphs.
Answer
Sign in to view the complete answer paper.
Rearrange following numbers using quick sort: 10, 6, 3, 7, 17, 26, 56, 32, 72.
Answer
Sign in to view the complete answer paper.
Discuss in detail about Linear and Binary search.
Answer
Sign in to view the complete answer paper.
Develop a binary search tree resulting after inserting the following integer keys: 49, 27, 12, 11, 33, 77, 26, 56, 23, 6.
Check whether the tree is almost complete or not?
Answer
Sign in to view the complete answer paper.
Determine the height of the tree.
Answer
Sign in to view the complete answer paper.
Write post order and preorder traversals.
Answer
Sign in to view the complete answer paper.
What is an array? Discuss different types of array with examples.
Answer
Sign in to view the complete answer paper.
Explain polynomial addition using arrays.
Answer
Sign in to view the complete answer paper.
Convert following expression x+(y*z)–((n*m+o)/p) into post form.
Answer
Sign in to view the complete answer paper.
Discuss sparse matrix representation using linked list.
Answer
Sign in to view the complete answer paper.
Show that the maximum number of nodes in a binary tree of height H is 2H+1 - 1.
Answer
Sign in to view the complete answer paper.
Write breadth first traversal algorithm. Explain with an example.
Answer
Sign in to view the complete answer paper.