0% found this document useful (0 votes)
155 views

Tutorial Questions (Final)

The document contains 20 questions related to data structures and algorithms. The questions cover topics like: 1. Performing operations like insertion, deletion on singly linked lists. 2. Converting infix expressions to postfix and evaluating postfix expressions. 3. Drawing concept maps for binary trees, binary search trees, AVL trees, B-trees, heaps, hash tables etc. and performing operations on them. 4. Resolving collisions in hash tables using separate chaining and linear probing methods. The questions are from 4 units - linked lists, stacks and queues, trees and hash tables. They assess different cognitive levels ranging from remembering to applying concepts.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
155 views

Tutorial Questions (Final)

The document contains 20 questions related to data structures and algorithms. The questions cover topics like: 1. Performing operations like insertion, deletion on singly linked lists. 2. Converting infix expressions to postfix and evaluating postfix expressions. 3. Drawing concept maps for binary trees, binary search trees, AVL trees, B-trees, heaps, hash tables etc. and performing operations on them. 4. Resolving collisions in hash tables using separate chaining and linear probing methods. The questions are from 4 units - linked lists, stacks and queues, trees and hash tables. They assess different cognitive levels ranging from remembering to applying concepts.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

SAVEETHA SCHOOL OF ENGINEERING

SAVEETHA INSTITUTE OF MEDICAL AND TECHNICAL SCIENCES


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Academic Year 2022-23
TUTORIAL QUESTIONS
Course Code – CSA03 Course Name - DATA STRUCTURES

TUTORIAL QUESTIONS - UNIT 2

Sl.No Questions CO/K Level

Insert a new-node 100 at the beginning of the single linked list. CO2 / K2,
1 Input: 22-> 77-> 55-> 88->
K3
Output: 10->22-> 77-> 55-> 88->
Insert a new-node 110 at the end of the single linked list. CO2 / K2,
2 Input: 22-> 77-> 55-> 88->
K3
Output: 22-> 77-> 55-> 88-> 110->
Insert a new-node 101 at the position 4 of the list. CO2 / K2,
3 Input: 55-> 77-> 88-> 99->22->
K3
Output: 55-> 77->8 8->101-> 99->22->
Delete a node at the beginning of the single linked list. CO2 / K2,
4 Input: 22-> 55-> 77-> 11->99->
K3
Output: 55-> 77->1 1->99->
Delete a node at the end of the single linked list.
CO2 / K2,
5 Input: 11->33-> 44-> 22->99->
K3
Output: 11-> 33-> 44-> 22->
Delete a node at the position 4 of the single linked list.
CO2 / K2,
6 Input: 22-> 77-> 99-> 22->55->77->
K3
Output: 22-> 77-> 99 ->55->77->
Find the difference between Maximum and Minimum elements in
the SLL. CO2 / K2,
7
Input 56-> 99-> 66-> 22-> 33-> K3
Output: Difference = 77
Search the key element =222 available in the SLL.
CO2 / K2,
8 Input : 55-> 99-> 66-> 22-> 33->
K3
Output : “NOT FOUND”
Perform the following operations using stack. Assume the size of
the stack is 5 and having a value of 22, 55, 33, 66, 88 in the stack
CO2 / K3,
9 from 0 position to size-1. Now perform the following operations:
K5
1) Invert the elements in the stack, 2) Pop(), 3) Pop(), 3) Pop(), 4)
Push(90), 5) Push(36), 6) Push(11), 7) Push(88), 8) Pop(), 9)
Pop(). Draw the diagram of stack and illustrate the above
operations and identify where the top is?.
Convert the following infix expression in to post fix expression. B - CO2 / K3,
10 ( C/D + (E % F* G ) / H) * J
K5
Evaluate the given postfix expression. a) 9 3 8 4 /*+ b) 6 2 + 6 3 /*
Illustrate the queue operation using following function calls of size
= 5. Enqueue(21), Enqueue(67), Enqueue(89), Dequeue(), CO2 / K3,
11 Enqueue(15), Enqueue(30), Enqueue(52), Dnqueue(), Dequeue(),
K5
Dequeue(),Dequeue().

Identify the given expression is balanced or not. [9 *(k+8 -{ 6 +e} + CO2 / K3,
12 77) / 100 ]
K5
Identify the given expression is balanced or not. (((a*b) +[u/2] –d)
Convert the following infix expression in to post fix expression.
(((a*b) + (c/d)) – (e*f)) CO2 / K3,
13
Evaluate the given postfix expression. a) 5 6 7 * 8 + - 2 / b) 3 7 * K5
48/+93*-

TUTORIAL QUESTIONS - UNIT 3

Sl No. QUESTIONS CO/K Level

Draw the concept map of the balance factor of each node


for the given non-linear data structure using AVL method

1. CO3/ K3

Draw the concept map of the balance factor of each node


for the given non-linear data structure using AVL method

2. CO3 / K3

Draw the concept map of Binary Tree for the expression


3. CO4 / K3
AB+CDE+**

4. Draw the concept map of Binary Tree for the expression CO4 / K3
A*B/C+E/F*G+K–X*Y
Draw the concept map of In-order, Pre-order and Post-
order traversal of the given tree

5. CO3/ K3

Draw the concept map of In-order, Pre-order and Post-


order traversal of the given tree

6. CO3/ K3

Draw the concept map of Binary Search Tree by inserting CO4 / K3


the following sequence of numbers 50,
7.
30,10,60,80,20,70,55,35,5. Show step-wise deletion of 5, 80
and 50
Draw the concept map of Binary Search Tree by inserting CO4 / K3
the following sequence of numbers 1, 2, 3, 4, 5, 25, 24, 23,
8.
6, 7, 22, 8, 9, 21, 10, 20, 19, 11, 12, 18 into an initially
empty BST. Delete 1, 4, 18, 20.
Draw the concept map of AVL tree for the following CO4 / K3
9.
elements 3,2,1,4,5,6,7 followed by 10 to 16 in reverse order
Draw the concept map of AVL tree for the following CO4 / K3
10.
elements 1,2,3,4,5,6,7,16,15,14,13,12.
Draw the concept map to build a max heap H from the CO4 / K3
11. given set of numbers: 45, 36, 54, 27, 63, 72, 61, and 18. Also
draw the memory representation of the heap.
Draw the concept map to Insert CO4 / K3
12. 10,15,12,23,21,1,6,43,34,56,78,23,45 into a binary heap.
Also apply Deletemin operation twice on the constructed
heap.
Draw the concept map to Construct a B-Tree of Order 3 by CO4 / K3
13. inserting numbers 34,26,45,12,87,56,78,22,23,24,65,85,95
into an initially empty B-tree.
Draw the concept map to Construct a B-Tree of Order 3 to CO4 / K3
14. insert 8, 9, 21, 10, 20, 19, 11, 12, 18,1,2,3,4 into an initially
empty B-tree.
Draw the concept map to construct a 2-3-4 Tree by CO4 / K3
15. inserting the following sequence of numbers 1, 2, 3, 4, 5,
25, 24, 23, 6, 7, 22, 8
Draw the concept map to construct a 2-3-4 Tree by CO4 / K3
16. inserting the following sequence of numbers 2, 3, 5,7, 11,
17, 19, 23, 29, 31
Draw the concept map to construct a Red-Black tree by CO4 / K3
17.
inserting numbers 2,1,4,5,9,3,6,7
Draw the concept map to construct a Red-Black tree by CO4 / K3
18.
inserting numbers 10,18,7,15,16,30,25,40,60,2,1,70
Draw the concept map to construct a Splay Tree by CO4 / K3
19.
inserting numbers 8,17,1,14,16,15
Draw the concept map to construct a Splay Tree by CO4 / K3
20.
inserting numbers 15,10,17,7, 13.16

TUTORIAL QUESTIONS - UNIT 4

Sl No. QUESTIONS CO/K Level

Consider a hash table with 9 slots. The hash function is


h(k)=k mod 9.the following keys ar e inserted in the order
1. 5,28,19,15,20,33,12,17,10. Draw the contents of the hash CO2 / K3
table when the collisions are resolved by (i) Separate
Chaining, (ii) Linear probing.
Given the input {4371, 1323, 6173, 4199, 4344, 9679, 1989}
and a hash function of h(X)=X (mod 10) show the resulting:
2. CO2 / K3
a. Separate Chaining hash table
b. Open addressing hash table using linear probing

3. Using separate chaining and linear probing method, store


CO2 / K3
the keys given below in an array of elements. How many
collisions occurred and what is the density of the list after
the keys are inserted. 28, 7, 846, 786, 431, 870, 612, 675,
876, 546, 34, 12.
The keys 12,18,13,2,3,23,5, and 15 are inserted into an
initially empty hash table of length 10 using linear probing
4. CO2 / K3
with hash function h(k)= k mod 10. What is the resultant
hash table?
A priority queue is implemented as a Max Heap. Initially it
has 5 elements. The level order traversal of the heap is:
5. 10,8,5,3,2. Two new elements 11 and 7 are inserted into CO2 / K3
the heap in that order. Give the level order traversal of
the heap after the insertion of elements.
Build the heap max heap for the following elements 1,12
6. CO2 / K3
,9,5,6,10.
Show the result of inserting 15,17,6,19,11,10,13,20,8,14,12
7. CO2 / K3
one at a time into an initially empty binary min heap
Construct heap sort for the initial key set 42, 23, 74,11,
8. CO3 / K3
65,58,94,36,99,87.
Apply the heap sort operation of insert and remove for the
9. CO3 / K3
following elements 81,89,9,11,14,76,54,22.
Build a Max Heap by investing the following data arriving
10. as a sequential set 23, 7, 92, 6, 12 ,14, 40, 44, 20, 21. Show CO3 / K3
the heap after deleting 2 elements.

11. Construct quick sort for the initial key set 4, 33, 74,10, CO3 / K3
67,58,94,36,100,87,79
Build the merge sort for the following elements
12. CO3 / K3
12,56,32,45,18,54.67,33
Draw the concept map of partitioning in quick sort, we will
now try to write an algorithm for it, which is as follows.

13. Step 1 − Choose the highest index value has pivot


CO3 / K3
Step 2 − Take two variables to point left and right of the
list excluding pivot
Step 3 − left points to the low index
Using elements your own
Draw the concept of insertion sort for the following
14. CO3 / K3
elements 8, 9, 21, 10, 20, 19, 11, 12, 18,1,2,3,4
Draw the concept map of merge sort, let’s consider an
15. CO3 / K3
array arr[] = {38, 27, 43, 3, 9, 82, 10}
Draw the concept map of insertion sort keeps on dividing
16. the list into equal halves until it can no more be divided.
CO3 / K3
Elements= {20, 21, 3, 9, 82,34,67,82}
Draw the concept of Radix sort for the following elements
17. CO3 / K3
46,78,23,21,10,7,34,56,78,55
Draw the concept map of quick sort, let’s consider an
18. CO3 / K3
array arr[] = {75,85,55,45,35,25,15,95}
Draw the concept map of Radix sort, let’s consider an
19. CO3 / K3
array arr[] = {14, 40, 44, 20, 21, 3, 9, 82}

TUTORIAL QUESTIONS - UNIT 5

Sl No. QUESTIONS CO/K Level

Write the topological sequence orderings for given


directed acyclic graph (Source Node 1)

1. CO5 / K2

Write the topological sequence orderings for given


directed acyclic graph (Source Node 7)

2. CO5 / K2

Consider the directed edge-weighted graph to find the


3. shortest path using Dijkstra’s algorithm. (Source Node S, CO5 / K3
Destination Node D)
Consider the directed edge-weighted graph to find the
shortest path using Dijkstra’s algorithm. (Source Node S,
Destination Node E)

4. CO5 / K3

Find the shortest path for unweighted graph (Source Node


1, Destination Node 8)

5. CO5 / K2

Find the shortest path for unweighted graph (Source Node


a, Destination Node e)

6. CO5 / K2
Construct the minimum spanning tree (MST) for the given
graph using Prim’s Algorithm

7. CO5 / K3

Construct the minimum spanning tree (MST) for the given


graph using Prim’s Algorithm

8. CO5 / K3

Construct the minimum spanning tree (MST) for the given


graph using Kruskal’s Algorithm.

9. CO5 / K3

Construct the minimum spanning tree (MST) for the given


graph using Kruskal’s Algorithm

10. CO5 / K3

Consider the following graph & construct BFS

11. CO5 / K3
Consider the following graph & construct BFS

12. CO5 / K3

Consider the following graph & construct DFS

13. CO5 / K3

Consider the following graph & construct DFS

14. CO5 / K3

You might also like