text messages messages in the text box below the buttons tell you whether the tree is red-black correct the tree is red-black correct if it adheres to rules through listed previously if it' not correctyou'll see messages advising which rule is being violated in some cases the red arrow will point to the place where the violation occurred where' the find buttonin red-black treesa search routine operates exactly as it did in the ordinary binary search trees described in the preceding it starts at the rootandat each node it encounters (the current node)it decides whether to go to the left or right child by comparing the key of the current node with the search key we don' include find button in the rbtree applet because you already understand this process and our attention will be on manipulating the red-black aspects of the tree experimenting with the workshop applet now that you're familiar with the rbtree buttonslet' do some simple experiments to get feel for what the applet does the idea here is to learn to manipulate the applet' controls later you'll use these skills to balance the tree experiment inserting two red nodes press start to clear any extra nodes you'll be left with the root nodewhich always has the value insert new node with value smaller than the rootsay by typing the number into the number box and pressing the ins button adding this node doesn' cause any rule violationsso the message continues to say tree is red-black correct insert second node that' larger than the rootsay the tree is still red-black correct it' also balancedthere are the same number of nodes on the right of the only non-leaf node (the rootas there are on its left the result is shown in figure notice that newly inserted nodes are always colored red (except for the rootthis is not an accident inserting red node is less likely to violate the red-black rules than inserting black one this is becauseif the new red node is attached to black oneno rule is broken it doesn' create situation in which there are two red nodes together (rule )and it doesn' change the black height in any of the paths (rule of courseif you attach new red node to red noderule will be violated howeverwith any luck this will happen only half the time whereasif it were possible to add new black nodeit would always change the black height for its pathviolating rule