You are on page 1of 3

COMSATS University, Islamabad

Discrete Structure
BSCS-2

Assignment #3
Due Date: 28th May, 2021 Total Marks: 35

---------------------------------------------------------------------------------------------------

Question # 01 (8 Marks)
Answer these questions about the rooted tree illustrated

a) Which vertex is the root?


b) Which vertices are internal?
c) Which vertices are leaves?
d) Which vertices are children of j?
e) Which vertex is the parent of q?
f ) Which vertices are siblings of o?
g) Which vertices are ancestors of u?
h) Which vertices are descendants of c?
Question # 02 (2+2+5 Marks)

1) What is the value of each of these prefix expressions?


a) + − ↑ 3 2 ↑ 2 3 / 6 − 4 2
b) * + 3 + 3 ↑ 3 + 3 3 3
2) What is the value of each of these postfix expressions?
a) 3 2 ∗ 2 ↑ 5 3 − 8 4 / ∗ −
b) 9 3 / 5 + 7 2 −∗

3)

a) Represent the expression ((x +2) ↑ 3) ∗ (y −(3+x)) − 5 using a binary tree.

Write this expression in


b) prefix notation.
c) postfix notation.
d) infix notation.

Question # 03 (2+2+2 Marks)


Determine the order in which a Pre-order traversal, Post-order traversal and In-order traversal
visits the vertices of the given ordered rooted tree.

Question # 04 (2+2+2 Marks)

Determine the number of vertices and edges and find the in-degree and out-degree of each vertex
for the given directed multigraph.
Question # 05 (6 Marks)

a) Find the sum of the degrees of the vertices of each graph and verify that it equals twice
the number of edges in the graph.

b) Are the graphs displayed in Figure bipartite?

C) Determine whether the given pair of directed graphs are isomorphic.

You might also like