You are on page 1of 1

DEPARTMENT OF ARTIFICIAL INTELLIGENCE AND DATA SCIENCE

18AIC203J – DATA STRUCTURES AND ALGORITHMS


ASSIGNMENT - I
Year/Semester & Branch: II / III & AI&DS Given Date:
Max. Marks: 50 Submission Date: 05.12.2022
Answer ALL Questions

1. For the tree given in the figure: Find the following


i) Which is root node?
ii) Which nodes are leaves?
iii) Name the parent node?
iv) List out the children?
v) write down the siblings?
vi) Compute the depth of the node J, node A and node L?
vii) Compute the height of tree?
viii) Write down the path from node B to node M?
ix)what is the length of path from node A to node K?

Represent the following tree using i) Array. ii) Linked List

2.

3. Construct a binary search tree for the following 12, 8, 15, 9, 7, 13, 16, 14, 2, 10, 20, 18, 11, 17
Construct an expression tree for the following expression.
4.
i) (a+b)*(c-d) ii) a+(b-c)*d*e+f iii) v1*v2-(v3+v4^v5)
Construct an AVL tree using C, G, M, S, J, E, A, Z, W, Y, D, X, Q, I, B and Delete any 3 nodes of.
5.
Your choice which will illustrate R0, R1, R-1 rotation.

Prepared by Approved by
Ms.A.Nithyasri – AP/AI&DS Dr.N.M.Saravanakumar – HOD/AI&DS

You might also like