AOA ASSINGMENT#2
Group members
NAME:Roll Numbers
Muntahir aliBCSM-S16-020
Faran Ahmad BCSM-S16-001
Mubeen AhmedBCSM-S16-021

Q: 12-2.1
ANSWER
In this question the part (c) and part (e) is not a sequence of node examined because in part (c) the value of 912 is greater then 911 and in part (e) the value of 347 is greater then 299
Therefore the left side of a child is must be smallest then their root node
Q:12-2.4
130265527802460023249102838612001712068167129200295720880553100229532244546040
40
17607067471652840476352141335
35
901430345790010
10
1893570230996830
30
1222172118135720
20
3255321109387560
60
.

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

ANSWER

74902927908900
2199122042815
5

Q:12-3.4
ANSWER
if the node has no child then there will not be a problem to delete a nod
272374142793914591514279393151762101966125291911048844125486810483855933879904782500009455457204259212460810
10
136187233872525291914779703
3
108625614248187
7
9597286270836
6
2244090142468316
16
3663815140509331
31
274948363667620
20

If the node has one child Firstly replace the child to his node
Now child is become a nod and a nod is became a child now delete the child
1017047109420000166343055278816438805133510036089621000260305448510776222917811338779203308110776222023353367962196575715297157
7
center144400416
16
4072512141495531
31
16795756854496
6
315862565633320
20
24513703827610
10

29828792394761020
1020
If the node has 3 child firstly find the in order success LDR then copy the successor child to nod and then delete the child
408622524765035311393078943453319190703411480060945136089626770863472774744302645923549754461632102356631
31
3356043102076916
16
22825552553917
7
363456430453020
20

Q: 12-2.5
28891154001041887166439015328762586515410
10
14947638146111
1
2409150757815
5
ANSWER
A nod has two child a predecessor is must a left side of nod and there is no right child of the predecessor. and the successor is a right side of this nod and there is no left child.
Q:12-1.1.

ANSWER
74838225527010
0010
height 2height 3
567122614070655389123823406504865537593444747238228923978613755312451363433702346556175135410
0010
5570436176323216
0016
5385678104333217
0017
507446147919521
0021
447141311991105
005
367442011305711
001
41634384662924
004
17801621046629148833210758125642041086053233464105687010992263078405642043267822126317140225521
0021
1319544141295616
0016
141640268397617
0017
3210127219404
004
left14548531
001
66745214027425
005

4951379289884352237532237362511674916045505223753982494485410242750441439833594104607546335230016
0016
5307519256449417
0017
4792115190325810
0010
5356131126181221
0021
48497386573885
005
38096366029121
001
4503353680534
004
17311862314670214981316142782023353923614146887787548914105113404687684852918301426223268091616
0016
1795631195153017
0017
2223851125073421
0021
109579412411415
005
163076154092510
0010
4050495606371
001
101167704
004
height 4height 5
348250231896323073940258703127134092129317233463815753541964987105978816731574761283673475340046521
0021
3167704282660117
0017
center227192216
0016
2349743176616510
0010
198097012306175
005
16338427195764
004
13590351418351
001
Height 6

Q:12-2.2 ANSWER
Tree Minimum:
If leftx ? nillReturn Tree Min(leftx)
Return x
Tree Maximum:
If rightx ? nillReturn Tree Max( rightx)
Return x
Q12-2.3
If leftx ? nillReturn Tree Max{leftx}
Y=p.xWhile y ? nill and x = leftx
Do x=y
Y=p.yReturn y