DS Assignment (2)
DS Assignment (2)
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.
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