Software Engineering Department
Umm Al-Qura University
1447 – 1st Semester
College of Computing
Computational Structures II –SE3402
Tutorial Exercises
Week: 4
Main Topic: Trees
Topics Covered: Introduction to trees, applications of trees
Introduction to Trees [From Rosen's book - Exercises (Pages 755-757)]
2. Which of these graphs are trees?
3. 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 h?
f ) Which vertices are siblings of o?
g) Which vertices are ancestors of m?
h) Which vertices are descendants of b?
5. Is the rooted tree in Exercise 3 a full m-ary tree for some positive integer m?
7. What is the level of each vertex of the rooted tree in Exercise 3?
9. Draw the subtree of the tree in Exercise 3 that is rooted at
a) a. b) c. c) e.
17. How many edges does a tree with 10,000 vertices have?
18. How many vertices does a full 5-ary tree with 100 internal vertices have?
19. How many edges does a full binary tree with 1000 internal vertices have?
20. How many leaves does a full 3-ary tree with 100 vertices have?
Applications of Trees [From Rosen's book - Exercises (Pages 769-772)]
2. Build a binary search tree for the words oenology, phrenology, campanology,
ornithology, ichthyology, limnology, alchemy, and astrology using alphabetical order.
4. How many comparisons are needed to locate or to add each of the words in the search
tree for Exercise 2, starting fresh each time?
a) palmistry b) etymology c) paleontology d) glaciology
Exercises for the minimum spanning tree (page 839)
Hint: All odd-numbered exercises are solved at the end of the book.