SlideShare a Scribd company logo
1 of 1
Download to read offline
void insertFixUp (Node node) This method recolors and rotates the tree to ensure that the tree
remains a valid red-black tree after inserting a new value. See the pseudocode below.
IbInsertFixup ( T , z ) 1 while ( z p color == RED ) if z p == z p p left y = z p p r i g h t if y coO r
== REF z p Color = BLACK y color = BLACK z P P COlOr = RED z = z p p else if z == z p r i
g h t z = z p leftrotate (T,z) z p COlOr = BLACK z p p color == RED rightRotate ( T , z p p )
else // z p == z p p r i g h t , swap left and right from if statement T. root. color = BLACK public
String tostring() This method should return a string representation of the tree from an in order
traversal. An in order traversal visits the left subtree, then the current node, then the right subtree
resulting in the data being printed in sorted order. This method has to be completed iteratively
(HINT: you might want to use a Stack). Examples - An empty tree should return the String " } " -
A tree with the nodes inserted in the order 2 , 1 , 3 should return the String " {( 1 , RE D ) , ( 2 ,
B L A C K ) , ( 3 , RE D )} "

More Related Content

More from OwenPBLRobertsv

Vitamins are organic compounds that you require in small amounts for i (1).pdf
Vitamins are organic compounds that you require in small amounts for i (1).pdfVitamins are organic compounds that you require in small amounts for i (1).pdf
Vitamins are organic compounds that you require in small amounts for i (1).pdfOwenPBLRobertsv
 
Valentino is a patient in a nursing home for 50 days of 2022- While in.pdf
Valentino is a patient in a nursing home for 50 days of 2022- While in.pdfValentino is a patient in a nursing home for 50 days of 2022- While in.pdf
Valentino is a patient in a nursing home for 50 days of 2022- While in.pdfOwenPBLRobertsv
 
Variable overhead cost- amounts as positive numbers- Leno Manufacturin.pdf
Variable overhead cost- amounts as positive numbers- Leno Manufacturin.pdfVariable overhead cost- amounts as positive numbers- Leno Manufacturin.pdf
Variable overhead cost- amounts as positive numbers- Leno Manufacturin.pdfOwenPBLRobertsv
 
Using the image below answer the following questions- a- Wh.pdf
Using the image below answer the following questions-            a- Wh.pdfUsing the image below answer the following questions-            a- Wh.pdf
Using the image below answer the following questions- a- Wh.pdfOwenPBLRobertsv
 
Using the information in the table below- what is the value of the M2.pdf
Using the information in the table below- what is the value of the M2.pdfUsing the information in the table below- what is the value of the M2.pdf
Using the information in the table below- what is the value of the M2.pdfOwenPBLRobertsv
 
What is an organophosphate pesticide- Why is this especially important.pdf
What is an organophosphate pesticide- Why is this especially important.pdfWhat is an organophosphate pesticide- Why is this especially important.pdf
What is an organophosphate pesticide- Why is this especially important.pdfOwenPBLRobertsv
 
What is a hyperspectral remote sensing system- What are the advantages.pdf
What is a hyperspectral remote sensing system- What are the advantages.pdfWhat is a hyperspectral remote sensing system- What are the advantages.pdf
What is a hyperspectral remote sensing system- What are the advantages.pdfOwenPBLRobertsv
 
What is a weakness of GDP as a metric- A- It doesn't measure non-monet.pdf
What is a weakness of GDP as a metric- A- It doesn't measure non-monet.pdfWhat is a weakness of GDP as a metric- A- It doesn't measure non-monet.pdf
What is a weakness of GDP as a metric- A- It doesn't measure non-monet.pdfOwenPBLRobertsv
 
what is Credit & Cash Collections-.pdf
what is Credit & Cash Collections-.pdfwhat is Credit & Cash Collections-.pdf
what is Credit & Cash Collections-.pdfOwenPBLRobertsv
 
What is a heartbeat protocol- Select one- a- A serious security bug in.pdf
What is a heartbeat protocol- Select one- a- A serious security bug in.pdfWhat is a heartbeat protocol- Select one- a- A serious security bug in.pdf
What is a heartbeat protocol- Select one- a- A serious security bug in.pdfOwenPBLRobertsv
 
What is 'limited liability-' a- Limited liability refers to the abilit.pdf
What is 'limited liability-' a- Limited liability refers to the abilit.pdfWhat is 'limited liability-' a- Limited liability refers to the abilit.pdf
What is 'limited liability-' a- Limited liability refers to the abilit.pdfOwenPBLRobertsv
 
What influences MNE to disperse or concentrate value activities- expla.pdf
What influences MNE to disperse or concentrate value activities- expla.pdfWhat influences MNE to disperse or concentrate value activities- expla.pdf
What influences MNE to disperse or concentrate value activities- expla.pdfOwenPBLRobertsv
 
What is a community- How may terrestrial and marine trophic pyramids d.pdf
What is a community- How may terrestrial and marine trophic pyramids d.pdfWhat is a community- How may terrestrial and marine trophic pyramids d.pdf
What is a community- How may terrestrial and marine trophic pyramids d.pdfOwenPBLRobertsv
 
What influences MNE to disperse or concentrate value activities- A- Su.pdf
What influences MNE to disperse or concentrate value activities- A- Su.pdfWhat influences MNE to disperse or concentrate value activities- A- Su.pdf
What influences MNE to disperse or concentrate value activities- A- Su.pdfOwenPBLRobertsv
 
What is a deficiency of the static planning budget- How does flexible.pdf
What is a deficiency of the static planning budget- How does flexible.pdfWhat is a deficiency of the static planning budget- How does flexible.pdf
What is a deficiency of the static planning budget- How does flexible.pdfOwenPBLRobertsv
 
What happens when the value of inventory is lower than its cost- 1- th.pdf
What happens when the value of inventory is lower than its cost- 1- th.pdfWhat happens when the value of inventory is lower than its cost- 1- th.pdf
What happens when the value of inventory is lower than its cost- 1- th.pdfOwenPBLRobertsv
 
What does the operator () stand for A-B in HDL- Intersection Complemen.pdf
What does the operator () stand for A-B in HDL- Intersection Complemen.pdfWhat does the operator () stand for A-B in HDL- Intersection Complemen.pdf
What does the operator () stand for A-B in HDL- Intersection Complemen.pdfOwenPBLRobertsv
 
What happens during isovolumetric contraction- AV and semilunar valves.pdf
What happens during isovolumetric contraction- AV and semilunar valves.pdfWhat happens during isovolumetric contraction- AV and semilunar valves.pdf
What happens during isovolumetric contraction- AV and semilunar valves.pdfOwenPBLRobertsv
 
What does it mean to say an organization is an open system- How is the.pdf
What does it mean to say an organization is an open system- How is the.pdfWhat does it mean to say an organization is an open system- How is the.pdf
What does it mean to say an organization is an open system- How is the.pdfOwenPBLRobertsv
 
What can be viewed as the X and Y axis in Tableau- Menu Sidebar Cards.pdf
What can be viewed as the X and Y axis in Tableau- Menu Sidebar Cards.pdfWhat can be viewed as the X and Y axis in Tableau- Menu Sidebar Cards.pdf
What can be viewed as the X and Y axis in Tableau- Menu Sidebar Cards.pdfOwenPBLRobertsv
 

More from OwenPBLRobertsv (20)

Vitamins are organic compounds that you require in small amounts for i (1).pdf
Vitamins are organic compounds that you require in small amounts for i (1).pdfVitamins are organic compounds that you require in small amounts for i (1).pdf
Vitamins are organic compounds that you require in small amounts for i (1).pdf
 
Valentino is a patient in a nursing home for 50 days of 2022- While in.pdf
Valentino is a patient in a nursing home for 50 days of 2022- While in.pdfValentino is a patient in a nursing home for 50 days of 2022- While in.pdf
Valentino is a patient in a nursing home for 50 days of 2022- While in.pdf
 
Variable overhead cost- amounts as positive numbers- Leno Manufacturin.pdf
Variable overhead cost- amounts as positive numbers- Leno Manufacturin.pdfVariable overhead cost- amounts as positive numbers- Leno Manufacturin.pdf
Variable overhead cost- amounts as positive numbers- Leno Manufacturin.pdf
 
Using the image below answer the following questions- a- Wh.pdf
Using the image below answer the following questions-            a- Wh.pdfUsing the image below answer the following questions-            a- Wh.pdf
Using the image below answer the following questions- a- Wh.pdf
 
Using the information in the table below- what is the value of the M2.pdf
Using the information in the table below- what is the value of the M2.pdfUsing the information in the table below- what is the value of the M2.pdf
Using the information in the table below- what is the value of the M2.pdf
 
What is an organophosphate pesticide- Why is this especially important.pdf
What is an organophosphate pesticide- Why is this especially important.pdfWhat is an organophosphate pesticide- Why is this especially important.pdf
What is an organophosphate pesticide- Why is this especially important.pdf
 
What is a hyperspectral remote sensing system- What are the advantages.pdf
What is a hyperspectral remote sensing system- What are the advantages.pdfWhat is a hyperspectral remote sensing system- What are the advantages.pdf
What is a hyperspectral remote sensing system- What are the advantages.pdf
 
What is a weakness of GDP as a metric- A- It doesn't measure non-monet.pdf
What is a weakness of GDP as a metric- A- It doesn't measure non-monet.pdfWhat is a weakness of GDP as a metric- A- It doesn't measure non-monet.pdf
What is a weakness of GDP as a metric- A- It doesn't measure non-monet.pdf
 
what is Credit & Cash Collections-.pdf
what is Credit & Cash Collections-.pdfwhat is Credit & Cash Collections-.pdf
what is Credit & Cash Collections-.pdf
 
What is a heartbeat protocol- Select one- a- A serious security bug in.pdf
What is a heartbeat protocol- Select one- a- A serious security bug in.pdfWhat is a heartbeat protocol- Select one- a- A serious security bug in.pdf
What is a heartbeat protocol- Select one- a- A serious security bug in.pdf
 
What is 'limited liability-' a- Limited liability refers to the abilit.pdf
What is 'limited liability-' a- Limited liability refers to the abilit.pdfWhat is 'limited liability-' a- Limited liability refers to the abilit.pdf
What is 'limited liability-' a- Limited liability refers to the abilit.pdf
 
What influences MNE to disperse or concentrate value activities- expla.pdf
What influences MNE to disperse or concentrate value activities- expla.pdfWhat influences MNE to disperse or concentrate value activities- expla.pdf
What influences MNE to disperse or concentrate value activities- expla.pdf
 
What is a community- How may terrestrial and marine trophic pyramids d.pdf
What is a community- How may terrestrial and marine trophic pyramids d.pdfWhat is a community- How may terrestrial and marine trophic pyramids d.pdf
What is a community- How may terrestrial and marine trophic pyramids d.pdf
 
What influences MNE to disperse or concentrate value activities- A- Su.pdf
What influences MNE to disperse or concentrate value activities- A- Su.pdfWhat influences MNE to disperse or concentrate value activities- A- Su.pdf
What influences MNE to disperse or concentrate value activities- A- Su.pdf
 
What is a deficiency of the static planning budget- How does flexible.pdf
What is a deficiency of the static planning budget- How does flexible.pdfWhat is a deficiency of the static planning budget- How does flexible.pdf
What is a deficiency of the static planning budget- How does flexible.pdf
 
What happens when the value of inventory is lower than its cost- 1- th.pdf
What happens when the value of inventory is lower than its cost- 1- th.pdfWhat happens when the value of inventory is lower than its cost- 1- th.pdf
What happens when the value of inventory is lower than its cost- 1- th.pdf
 
What does the operator () stand for A-B in HDL- Intersection Complemen.pdf
What does the operator () stand for A-B in HDL- Intersection Complemen.pdfWhat does the operator () stand for A-B in HDL- Intersection Complemen.pdf
What does the operator () stand for A-B in HDL- Intersection Complemen.pdf
 
What happens during isovolumetric contraction- AV and semilunar valves.pdf
What happens during isovolumetric contraction- AV and semilunar valves.pdfWhat happens during isovolumetric contraction- AV and semilunar valves.pdf
What happens during isovolumetric contraction- AV and semilunar valves.pdf
 
What does it mean to say an organization is an open system- How is the.pdf
What does it mean to say an organization is an open system- How is the.pdfWhat does it mean to say an organization is an open system- How is the.pdf
What does it mean to say an organization is an open system- How is the.pdf
 
What can be viewed as the X and Y axis in Tableau- Menu Sidebar Cards.pdf
What can be viewed as the X and Y axis in Tableau- Menu Sidebar Cards.pdfWhat can be viewed as the X and Y axis in Tableau- Menu Sidebar Cards.pdf
What can be viewed as the X and Y axis in Tableau- Menu Sidebar Cards.pdf
 

Recently uploaded

Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 

Recently uploaded (20)

Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 

void insertFixUp (Node node) This method recolors and rotates the tree.pdf

  • 1. void insertFixUp (Node node) This method recolors and rotates the tree to ensure that the tree remains a valid red-black tree after inserting a new value. See the pseudocode below. IbInsertFixup ( T , z ) 1 while ( z p color == RED ) if z p == z p p left y = z p p r i g h t if y coO r == REF z p Color = BLACK y color = BLACK z P P COlOr = RED z = z p p else if z == z p r i g h t z = z p leftrotate (T,z) z p COlOr = BLACK z p p color == RED rightRotate ( T , z p p ) else // z p == z p p r i g h t , swap left and right from if statement T. root. color = BLACK public String tostring() This method should return a string representation of the tree from an in order traversal. An in order traversal visits the left subtree, then the current node, then the right subtree resulting in the data being printed in sorted order. This method has to be completed iteratively (HINT: you might want to use a Stack). Examples - An empty tree should return the String " } " - A tree with the nodes inserted in the order 2 , 1 , 3 should return the String " {( 1 , RE D ) , ( 2 , B L A C K ) , ( 3 , RE D )} "