Docstoc

cs301 assingment solution file

Document Sample
cs301 assingment solution file Powered By Docstoc
					10, 5 ,3, 15, 17, 19, 21, 25, 24, 22
Ye 100% true solution hai mene step by step solve kea hai sirf samjhane k leay lakin aap
ne sirf last wale diagram he bnani hai assignment me bake ke zarrorat nhe sir ne sirf yehe
bnane ka kha hai .
Hr bar new digit inter krne k bad left and right nodes ka balance maloom krna hai yane
left nodes - right nodes
 (node wo line hai jo aik digit se dosre digit ke trf ja rhe hai )
Aap ne balance maloom krne k leay digits ko count nhekrna sirf nodes(lines) ko count
krna hai.
Ager ans 0,1,-1 aye to balance hoga or ye AVL tree hoga .
Otherwise rotate krna hai take balance bn jaey.



                                       10




                               5



                      3




                                         5




                                                        10
                               3
                 5




                          10
        3



                                    15




                                         17
            10


                     15
    5




                               17


3
                 10


                                15
        5




                                          17


3
                      15

                                                19

                           17
            10



                                     19
    5                                                 21




                                               21
3



                                                     25
             15




        10         17




                        19
    5




                             21

3




                              25




                  24
Required final AVL tree


                          17


               15
                                    19




        10                                21




    5                                      25




                                     24
3




                               22

				
DOCUMENT INFO
Shared By:
Stats:
views:16
posted:6/2/2012
language:
pages:6
Description: cs301 assingment solution file