3 views

Uploaded by Arockiaruby Ruby

save

- Rao Lecture 8
- High-Throughput IP-Lookup Supporting Dynamic Routing Tables Using FPGA
- 23_2
- cs301 quiz 10-1-2011
- ee220s02lec6 (1)
- AVL Tree
- Avl Deletion
- ex7
- 2-3-trees
- MIT15_053S13_lec18.pdf
- MELJUN_CORTES_JEDI Slides Data Structures Chapter09 BST
- Lec 9 Trees
- IrisR
- Testing 7
- vraylog
- Algorithm Book
- GDC13 VandenBergen Gino Physics Tut
- B Trees and its Variants
- Solutions Chapter 12 Making Hard Decisions With Decision Tool
- q.bankds
- 176_leseprobe
- Appendix A
- Discret Math Unit 4-6
- LTL
- Peer to Peer
- Full Text 01
- compiler_mod 5-symbol table.pptx
- Multi Objective OptimizationMOEA
- Interview
- Vector Quantization
- Teste-Ort.ex.an.Viarna-Ro-2017-20181203712261.doc
- USO DE MICRONUTRIENTES
- Feminismo y subjetivación. la creación de una nueva posibilidad vital con un fondo estético
- aSBAK
- Guía de Actividades y Rubrica de Evaluación - Reto 2 - Apropiación Unadista
- peykedamparvar mordad&shahrivar
- EAN13Generator.xlsx
- Diseño de Captacion de Un Manantial a Media Ladera Concentrado
- Cover
- Sii
- aduh.docx
- L_Advanced_LG (przeciągnięte)
- Mapa da Educação - Brasil (2017)
- bab
- ¿Qué Dice La Biblia Sobre La Homosexualidad
- KATA PENGANTAR.docx
- Conversion Vehicular a GLP UNAC
- Título 2.docx
- o-render-engine.pdf
- Lectura Para Reflexionar - Tema 3
- Teste Grila Pentru Concursuri Si Examene
- Las Rocas Ígnea1
- Atlantic Monthly - Coal
- ERC Estimation
- psicologia 5.docx
- Sarah
- FORMATO-AUDITORIA
- VILA BOA E GOIÂNIA O DISCURSO DA MODERNIDADE EMPREGADO POR MEIO DO ASPECTO VISUAL ARQUITETÔNICO EM DIFERENTES ESPAÇOS E TEMPOS HISTÓRICOS
- Sept
- Guia_AEA_Inst_hasta_10_Kw_COLOR.pdf
- பூ பாடல்கள்
- Kandangi Kandangi Katti Vandha Ponnu
- Malli Ye
- Gundu Malli Gundu Malli
- Eng of Kandangi
- Then Malli
- Ootha Poo Song
- Kathirikai Kara Kuzhambu
- பொங்கல பொங்கல வைக்க மஞ்சல மஞ்சல
- மானா மதுரை குண்டு மல்லியே
- ரோசாப்பூ சின்ன ரோசாப்பூ
- செம்பருத்தி பூவே செம்பருத்தி பூவே
- M
- பன்னீரில் நனைந்த பூக்கள் மெல்ல சிரிக்க
- Poove Poove Pen Poove
- Attachment.2pdf
- Mundhinam Parthene Song Lyrics and English
- Voda Voda Voda Thooram Korayala Eng
- Nee Enbathae Naanthaanadi
- Ilaya Nila Pozhigiradhae Eng Version
- Vizhi Moodi Yosithaal Angeyum Vandhaai Munney Munney
- Enna Saththam Indha Eng Translation
- Grid Anatomy
- KaNduKondain KaNduKondain.docx
- Eng Trans of Illai Illai Solla Oru KaNam Poadhum
- Eng Trans of Ava Enna Enna Thedi Vantha Anjala
- Chicken Manjuriyan
- Eng Trans of Illai Illai Solla Oru KaNam Poadhum
- Nenjukkul Peidhidum Maa Mazhai
- Trignomatric Table

You are on page 1of 3

From Wikipedia, the free encyclopedia

Generic tree rotations. In discrete mathematics, tree rotation is an operation on a binary tree that changes the structure without interfering with the order of the elements. A tree rotation moves one node up in the tree and one node down. It is used to change the shape of the tree, and in particular to decrease its height by moving smaller subtrees down and larger subtrees up, resulting in improved performance of many tree operations. There exists an inconsistency in different descriptions as to the definition of the direction of rotations. Some say that the direction of a rotation depends on the side which the tree nodes are shifted upon whilst others say that it depends on which child takes the root's place (opposite of the former). This article takes the approach of the side where the nodes get shifted to.

Contents Illustration

Another constraint is the main property of a binary search tree. Q. RS for rotation side upon to rotate and OS for opposite . Pivot for the node which will become the new parent node. The inverse operation is the left rotation. Using the terminology of Root for the parent node of the subtrees to rotate. As you can see in the diagram. namely that the right child is greater than the parent and the left child is less than the parent. Assuming this is a binary search tree. as stated above. Notice that the right child of a left child of the root of a sub-tree (for example node B in the diagram for the tree rooted at Q) can become the left child of the root. When a subtree is rotated. This operation results in a rotation of the tree in the clockwise direction. Detailed illustration Pictorial description of how rotations are made. that itself becomes the right child of the "new" root in the rotated sub-tree. the order of the leaves doesn't change. which results in a movement in a counter-clockwise direction (the left rotation shown above is rooted at P). The opposite operation also preserves the order and is the second kind of rotation. The key to understanding how a rotation functions is to understand its constraints. In particular the order of the leaves of the tree (when read left to right for example) cannot change (another way to think of it is that the order that the leaves would be visited in an in-order traversal must be the same after the operation as before). The alphabetic characters above are used as placeholders for these variables. the elements must be interpreted as variables that can be compared to each other. or rooted at. This makes tree rotations useful for rebalancing a tree.The right rotation operation as shown in the image above is performed with Q as the root and hence is a right rotation on. without violating either of those constraints. the subtree side upon which it is rotated increases its height by one node while the other subtree decreases its height.

side of rotation. In the above diagram for the root Q. The programmer must also make sure that the root's parent points to the pivot after the rotation. Also.RS = Root Root = Pivot This is a constant time operation. .OS = Pivot. the programmer should note that this operation may result in a new root for the entire tree and take care to update pointers accordingly.RS Pivot. the RS is C and the OS is P.OS Root. The pseudo code for the rotation is: Pivot = Root.

- Rao Lecture 8Uploaded bySakura2709
- High-Throughput IP-Lookup Supporting Dynamic Routing Tables Using FPGAUploaded byfreezehead
- 23_2Uploaded bySukhamay Jana
- cs301 quiz 10-1-2011Uploaded byAwais Akram
- ee220s02lec6 (1)Uploaded byanony_1
- AVL TreeUploaded byTamil Vanan
- Avl DeletionUploaded byGabrielAparicio
- ex7Uploaded byArockiaruby Ruby
- 2-3-treesUploaded bypooja0100
- MIT15_053S13_lec18.pdfUploaded byShashank Singla
- MELJUN_CORTES_JEDI Slides Data Structures Chapter09 BSTUploaded byMELJUN CORTES, MBA,MPA
- Lec 9 TreesUploaded bywilliamsock
- IrisRUploaded byevanialisal
- Testing 7Uploaded bydoomachaley
- vraylogUploaded bySundeep Parmar
- Algorithm BookUploaded bybcdchetan
- GDC13 VandenBergen Gino Physics TutUploaded byBruno Carvalho Dos Santos
- B Trees and its VariantsUploaded byzaree
- Solutions Chapter 12 Making Hard Decisions With Decision ToolUploaded byChris Goyette
- q.bankdsUploaded bypriya_coolcandy1583
- 176_leseprobeUploaded byraju_s
- Appendix AUploaded byVasantha Kumari
- Discret Math Unit 4-6Uploaded byErick Infante
- LTLUploaded byPandaciuc Ilie
- Peer to PeerUploaded byAkshay Varma
- Full Text 01Uploaded byawadhesh786
- compiler_mod 5-symbol table.pptxUploaded byvidhya_bineesh
- Multi Objective OptimizationMOEAUploaded bycacalau123
- InterviewUploaded byManoj Gadge
- Vector QuantizationUploaded byRex Jim

- பூ பாடல்கள்Uploaded byArockiaruby Ruby
- Kandangi Kandangi Katti Vandha PonnuUploaded byArockiaruby Ruby
- Malli YeUploaded byArockiaruby Ruby
- Gundu Malli Gundu MalliUploaded byArockiaruby Ruby
- Eng of KandangiUploaded byArockiaruby Ruby
- Then MalliUploaded byArockiaruby Ruby
- Ootha Poo SongUploaded byArockiaruby Ruby
- Kathirikai Kara KuzhambuUploaded byArockiaruby Ruby
- பொங்கல பொங்கல வைக்க மஞ்சல மஞ்சலUploaded byArockiaruby Ruby
- மானா மதுரை குண்டு மல்லியேUploaded byArockiaruby Ruby
- ரோசாப்பூ சின்ன ரோசாப்பூUploaded byArockiaruby Ruby
- செம்பருத்தி பூவே செம்பருத்தி பூவேUploaded byArockiaruby Ruby
- MUploaded byArockiaruby Ruby
- பன்னீரில் நனைந்த பூக்கள் மெல்ல சிரிக்கUploaded byArockiaruby Ruby
- Poove Poove Pen PooveUploaded byArockiaruby Ruby
- Attachment.2pdfUploaded byArockiaruby Ruby
- Mundhinam Parthene Song Lyrics and EnglishUploaded byArockiaruby Ruby
- Voda Voda Voda Thooram Korayala EngUploaded byArockiaruby Ruby
- Nee Enbathae NaanthaanadiUploaded byArockiaruby Ruby
- Ilaya Nila Pozhigiradhae Eng VersionUploaded byArockiaruby Ruby
- Vizhi Moodi Yosithaal Angeyum Vandhaai Munney MunneyUploaded byArockiaruby Ruby
- Enna Saththam Indha Eng TranslationUploaded byArockiaruby Ruby
- Grid AnatomyUploaded byArockiaruby Ruby
- KaNduKondain KaNduKondain.docxUploaded byArockiaruby Ruby
- Eng Trans of Illai Illai Solla Oru KaNam PoadhumUploaded byArockiaruby Ruby
- Eng Trans of Ava Enna Enna Thedi Vantha AnjalaUploaded byArockiaruby Ruby
- Chicken ManjuriyanUploaded byArockiaruby Ruby
- Eng Trans of Illai Illai Solla Oru KaNam PoadhumUploaded byArockiaruby Ruby
- Nenjukkul Peidhidum Maa MazhaiUploaded byArockiaruby Ruby
- Trignomatric TableUploaded byArockiaruby Ruby