0% found this document useful (0 votes)
17 views3 pages

DS Assignment (2)

Uploaded by

Sailaja Sailu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views3 pages

DS Assignment (2)

Uploaded by

Sailaja Sailu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

UNIT-III

1. Define stack and give one application? Convert the given infix expression to its postfix
Expression i. ((A+((B^C)-D))*(E-(A/C)))
ii. (a - b / c ^ d) / (e + f * g)
iii. A + B* (C+D) / F + D*E
iv. A+ (B*C- (D/E^F)*G)*H
v. ((A –(B+C) * D) / (E+F))
vi. A*(B+D)/E-F*(G+H/K).
2. a. Transform the infix expression into its equivalent Pre -fix expression:
(A+B^D)/(E*F)+G.

b. Explain the evaluation of prefix expression.

Find the equivalent prefix of :8 6 3 + * 1 2 3 -/-

3. Explain the procedure to evaluate postfix expression 6 2 3 + - 3 8 2 / + * 2 4 3 + .


evaluate the following Postfix expression ABC*+D+, where A=2,B=3,C=4, and D=5.
Evaluate the following postfix expression 7 3 4 + - 2 4 5 / + * 6 / 7 +
4. Explain the implementation of Stack Operations using Arrays & Linked List
5. Show how to reverse a single linked list
6. What is recursion? How it solves the problems? Explain its application in solving
Towers of Hanoi problem.
UNIT-IV
1. What is Priority Queue? Explain the implementation of Priority queue .Write an
algorithm for Performing various operations on Priority queues with an example.
2. Write an algorithm to implement queue using linked list
3. Explain about Input Restricted and Output Restricted DEQUES.
4. Explain the operations of queue with suitable algorithms and examples.
UNIT-V(TREES)
1. What is a Binary Search Tree? Draw a binary search tree step by step
i. 43, 75, 19, 36, 8, 62, 49, 84, 12, 18, 29.
ii. 1,4, 7, 10, 17, 21, 31, 25, 19, 20, 28, 42
iii. 13, 3, 4, 12, 14, 10, 5, 1, 8, 2, 7, 9, 11, 6, 18
iv. 23, 12, 45, 36, 5, 15, 39, 2, 19
v. 49, 27, 12, 11, 33, 77, 26, 56, 23, 6
vi. 10,12,5,4,20,8,7,15,13
2. Construct a binary tree having the following traversal sequences:
i. Preorder Traversal: A B C D E F G H I
Inorder Traversal: B C A E D G H F I
ii. 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
iii. Inorder Traversal is {4, 8, 2, 5, 1, 6, 3, 7}
Post order Traversal is{8, 4, 5, 2, 6, 7, 3, 1}
3. Write algorithm to insert and delete an element from binary search tree.

4. Consider the following tree:

i) Post-order traversal of the tree


ii) Level-order traversal of the tree
iii) What is the depth of the tree? "Is it
a complete binary tree" – Justify
5. Discuss various Tree traversal techniques with neat diagrams
UNIT-V(GRAPHS)
1. Write short notes on Graph terminology and outline the properties of a Graph.
2. Write an algorithm for Depth First Search traversal and apply DFS to the
following graph and give the traversal order. (Consider A as the Starting
node)

3. Write an algorithm for Depth First Search traversal and apply DFS to the
following graph and give the traversal order. (Consider A as the Starting
node)
4. Which data structure is used in BFS implementation? Explain the step by
stepprocedure to traverse the graph shown in figure using BFS algorithm.

5. Define the following terms with respect of a graph: i) Degree of vertex ii)
Incident edge iii) Directed edge iv) Path
UNIT-V(HASHING)
1. Perform the Linear probing with elements 8,26,37,51,11,36,42 with table
size 10
2. Following elements are inserted into an empty hash table with hash
function f(x) = x% 17 and quadratic probing. Explain. 58, 48, 79, 46, 54,
32, 24, 19, 18, 35, 15, 84, 16, 12
3. Perform the double hashing with the elements 97, 40, 15, 22, 17, 89, 67
with table size 10

Last Date of Submisssion-5/6/2024

You might also like