Académique Documents
Professionnel Documents
Culture Documents
ID : ITITIU14083
LAST HOMEWORK
a)
b)
c)
d)
e)
f)
g)
h)
Exercise 4 :
Exercise 6 :
The rooted tree in exercise 4 is not full m-ary tree because we have 2(j, k)
or 3(q ,r, s) childrens in a tree.
Exercise 10 :
b
c
e
f
j
Exercise 22 :
The chain letter can be represented using a 5-ary tree. Because 10000
people send out the letter, the number of internal vertices is 10000.
So, the number of people have seen letter is
n=5.10000+1=50001.
The number of people have received letter but not send out is 5000110000 = 40001 people.
Exercise 28 :
In m-ary tree we have:
So,
1+m+m2+ + mh= (mh+1-1)/(m+1) and leaves in m-ary tree is mh
Exercise 32 :
Exercise 2 :
oenolo
gy
campanolo
gy
alche
astrolo
phrenolo
gy
ichthyolo
limnolog
ornitholo
Exercise 6 :
Weighings of a balance scale : [log34]=2
We have :
Exercise 20 :
1
1
e
0
b)
0
a:1, e:01, t:001, s:0001, n:00001
0
1
0
1
1
n
0
e
t
0
1
1
0
1
1
0
n
Exercise 22 :
a:001, b:0001, e:1, r:0000, s:0100, t:001, x:01010
Exercise 4 :
a) At what level is v?
Level 5.
b) What is the address of the parent of v?
3.4.5.2
c) What is the least number of siblings v can have?
V can have 3 other siblings not including it self .
d) What is the smallest possible number of vertices in T if v has
this address?
We have 19 vertices in the tree.
e) Find the other addresses that must occur.
3.4.5.2.1, 3.4.5.2.3, 3.4.5.2.3
3.4.5.1, 3.4.5.2
3.4.1, 3.4.2, 3.4.3, 3.4.4, 3.4.5
3.1, 3.2, 3.3, 3.4.
3
2
1
0
Exercise 8 :
preorder traversal : Root Left Right => d, I, m, n, o, j, e, b, f, g, k, p, l,
h, c, a.
Exercise 12 :
Inorder traversal : Left Root Right => k, e, l, m, b, f, r, n, s, g, a, c, o, h,
d, I, p, j, q.
Exercise 14 :
Postorder traversal : Left Right Root => d, I, m, n, o, j, e, b, f, g, k, p, l,
h, c, a.
Exercise 18 :
a)
P
b)
Exercise 2 :
Exercise 6 :
Exercise 10 :
case 1 :
c
a
d
case 2 :
c
a
d
case 3 :
c
a
b
d
case 4 :
c
b
d