red-black trees symmetrical cases (for left or right childreninside or outside grandchildrenand so on)the actual code is more lengthy and complex than one might expect it' therefore hard to learn about the algorithm by examining code accordinglythere are no listings in this you can create similar functionality using tree with the code shown in howeverthe concepts you learn about here will aid your understanding of trees and are themselves quite interesting conceptual for our conceptual understanding of red-black treeswe will be aided by the rbtree workshop applet we'll describe how you can work in partnership with the applet to insert new nodes into tree including human into the insertion routine certainly slows it down but also makes it easier for the human to understand how the process works searching works the same way in red-black tree as it does in an ordinary binary tree on the other handinsertion and deletionwhile based on the algorithms in an ordinary treeare extensively modified accordinglyin this we'll be concentrating on the insertion process top-down insertion the approach to insertion that we'll discuss is called top-down insertion this means that some structural changes may be made to the tree as the search routine descends the tree looking for the place to insert the node another approach is bottom-up insertion this involves finding the place to insert the node and then working back up through the tree making structural changes bottom-up insertion is less efficient because two passes must be made through the tree balanced and unbalanced trees before we begin our investigation of red-black treeslet' review how trees become unbalanced fire up the binary tree workshop applet from (not this rbtree appletuse the fill button to create tree with only one node then insert series of nodes whose keys are in either ascending or descending order the result will be something like that in figure the nodes arrange themselves in line with no branches because each node is larger than the previously inserted oneevery node is right childso all the nodes are on one side of the root the tree is maximally unbalanced if you inserted items in descending orderevery node would be the left child of its parentand the tree would be unbalanced on the other side