You are on page 1of 7

Prerana Educational and Social Trust®

PES Institute of Technology and Management


NH-206,Sagar Road,Shivamogga-577204

Department of Computer Science and Engineering

Sub: Data structure and Its Applications


Sub Code: 21CS32
Course Instructor: Ashwini S P
Semester: 3
Academic Year: 2022-23
Module 1 Questions
1. Define data structure. Explain with a neat block diagram different types of
data structures.
2. What are the primitive operations that can be performed on data structures?
(traversing, inserting, deleting, searching, sorting)
3. List and explain different operations that can be carried on arrays.(
searching, sorting, inserting, replacing the array element, array traversing)
4. Define structure. How it is different from array. Explain different types of
structure declaration with examples.
5. Define structure. Explain how structure is defined.
6. Explain array of structure using program.
7. Explain self referential structures using a simple program.
8. Differentiate structures and unions.
9. Explain nested structure concept using a simple program.
10. What is dynamic memory allocation? Explain 4 functions for dynamic
memory allocation.
11.How memory is allocated dynamically to 1-D array explain with a
program.(storing the contents of array into a pointer).
12. Define sparse matrix. Express the following matrix in triplet form and find
its transpose.
15 0 0 22
0 11 3 0
0 0 0 -6
0 0 0 0
91 0 0 0
0 0 28 0

13. Write a C code to display the triplet form for the sparse matrix.
14. Write a C code to display the transpose of sparse matrix.
Prerana Educational and Social Trust®
PES Institute of Technology and Management
NH-206,Sagar Road,Shivamogga-577204

Department of Computer Science and Engineering

Module 2 Questions
1. Define stack. Explain the different operations that can be performed on stack
using c-functions.
2. Write an algorithm to convert infix expression to postfix expression.
3. Write a program to convert infix to postfix expression using stack Data
structure.
4. Write the postfix form of the following infix expression using stack.
i) A$B*C-D+E/F/(G+H)
ii) A-B/(C*D$E)
6. Write a program to evaluate the postfix expression using stack Data
structure.
7. Write an algorithm to evaluate postfix expression. Apply the same for the
given postfix expression ABC-D*+E$F+ and assume
A=6,B=3,C=2,D=5,E=1 AND F=7.
8. Write an algorithm to convert infix to prefix expression. Apply the same to
convert the following infix expression to prefix expression.
a. (A+B*C)*((D+E-F)/J)
8. Write a program to convert infix to prefix expression using stack.
9. Define recursion. Write a program to find out the factorial of a number using
recursion.
10.Write a program to solve Tower of Hanoi problem for ‘n’ number of discs
using recursion.
11.Write a program to find the GCD and LCM of 2 numbers using recursion.
12.Write C functions for CQInsert() and CQDelete operations on circular
queue.
13.Define queue. List different types of queues. State the limitation of ordinary
queue. Explain how do you overcome the limitation by specifying the
required C- statements and diagrammatic representation using an example.
14.Write a note on Dqueue( Double Ended) and priority queue
15. Write a program to implement linear queue operations.
Prerana Educational and Social Trust®
PES Institute of Technology and Management
NH-206,Sagar Road,Shivamogga-577204

Department of Computer Science and Engineering

Module 3 Questions
1. Define Linked list. Write C functions for the following operations on SLL.
a) Insertion at the beginning b) Insertion at the end
c) Deletion at the beginning d)Deletion at the end
2. Explain concept of sparse matrix representation using linked list. Represent
the following sparse matrix in linked list format.

00304
A= 00570
00000
02600

3. Write C functions for following operations on circular linked list.


a) Insertion at the beginning (Insert node at front)
b) Insertion at the end c) Deletion at the beginning
d) Deletion at the end (delete node at rear)
4. Write and explain how do you implement the operations of stack using SLL
with the help of C statements.
(for this explain insert at front and delete at front functions)
5. Write and explain how do you implement the operations of queue using
SLL with the help of C statements.
(for this explain insert at front and delete at end functions)
6. Differentiate SLL and DLL.
7. Implement addition and deletion of a node on a DLL with required C
statements.
8. Explain different types of Linked List with neat diagram.
9. Write a C function for the concatenation of two SLL.
10.Write a C routine to search for an element in SLL.
Prerana Educational and Social Trust®
PES Institute of Technology and Management
NH-206,Sagar Road,Shivamogga-577204

Department of Computer Science and Engineering

Module 4 Questions
1. Define binary tree with an example. Write recursive routine (Function) to
traverse the given tree using inorder, preorder and postorder.
2. Define binary search tree. Draw the BST for the following. Also show the
array and linked list representation of the same.
14 15 4 9 7 18 3 5 16 20 17 9
100 85 45 55 110 20 70 65
3. Given the following traversal draw the binary tree
i)
a) Inorder: 4 2 5 1 6 7 3 8
b) Postorder: 4 5 2 6 7 8 3 1
ii)
a) Preorder: A B C E I F J D G H K L
b) Inorder: E I C F J B G D K H L A
4. Represent the below tree using
a) Linked list representation.
b) Array representation
A

B C D

E F
G H

J K
5. Write a function to insert the element in a binary search tree.
6. Define threaded binary tree. List its advantages and disadvantages. Draw
one way threading and 2 way threading of the following binary tree.
A

B C

D E F G

H
Prerana Educational and Social Trust®
PES Institute of Technology and Management
NH-206,Sagar Road,Shivamogga-577204

Department of Computer Science and Engineering


7. Define binary tree traversal method. Find the inorder, preorder and postorder
for the following.

B C

D A

G F

8. Explain how do you construct and add a node to binary tree using C
statements.
9. Define expression tree. Construct an expression tree for: a + b *c / f ^ g – h.
10.Write diagrammatic explanation, explain how do you create and construct a
BST. Also write C functions for the same.
11. Explain the tree terminologies
a) Binary tree
b) Binary search tree
c) Level of a node
d) Complete binary tree
e) Degree of a tree
f) Expression tree
g) Threaded binary tree
h) Ancestor
i) Descendant
j) Degree of a node
k) Full/ strict Binary tree
Prerana Educational and Social Trust®
PES Institute of Technology and Management
NH-206,Sagar Road,Shivamogga-577204

Department of Computer Science and Engineering

Module 5 Questions

1. Define graph. Also define the following graph terminologies.


1. Diagraph
2. Weighted graph
3. Self loop
4. Parallel edges
5. Cyclic graph
6. Path
7. Connected graph
8. Spanning graph

2. Define traversal method. List and explain the different graph traversal
methods. Find the resultants of the types of graph traversal methods ( bfs
and dfs) on the following graph. ( consider ‘a’ as starting vertex)

b d

a f

c e

3. For the graphs below given show the adjacency matrix and adjacency list
representation.

b
e1
A C
e3

e2
a c e e5
e4
5 A

B F e7
e6
d f
Prerana Educational and Social Trust®
PES Institute of Technology and Management
NH-206,Sagar Road,Shivamogga-577204

Department of Computer Science and Engineering

4. Explain graph traversal methods (BFS and DFS) by writing C routines(


function).
5. What is collision? What are the methods to resolve collision? Explain
linear probing with an example.
6. Define hashing. Explain in detail about static and dynamic hashing.
7. Explain different types of hash function with example.
8. Define AVL tree. Construct AVL Tree by inserting the following data.
14, 17, 11, 7, 53, 4, 13, 12, 8, 60, 19,16,20
9. Define AVL search tree. Construct AVL search tree by inserting the
following elements in the order of their occurrence.
64, 1, 44, 26, 13, 110, 98, 85
10.Define B-Tree. What are its properties?
11.Explain how to
1. Search for an element in B-Tree
2. Inserting a new element in B-Tree
3. Deleting an element from a B-Tree

11. What are the applications of B-Tree


12. Define Red Black Tree. What are its properties?
13. Construct Red Black Tree by inserting the following data.
10, 18, 7 ,15, 16, 30, 25, 40, 60, 2, 1, 70

You might also like