to see if you're right as the tree gets larger you'll need to move around it to see all the nodes click on node to see its children (and their childrenand so onif you lose track of where you areuse the zoom key to see the big picture how many data items can you insert in the treethere' limit because only four levels are allowed four levels can potentially contain nodesfor total of nodes (all visible on the zoomed-out displayassume full items per node gives data items howeverthe nodes can' all be full at the same time long before they fill upanother root splitleading to five levelswould be necessaryand this is impossible because the applet supports only four levels you can insert the most items by deliberately inserting them into nodes that lie on paths with no full nodesso that no splits are necessary of course this is not reasonable procedure with real data for random data you probably can' insert more than about items into the applet the fill button allows only to minimize the possibility of overflow java code for tree in this section we'll examine java program that models tree we'll show the complete tree java program at the end of the section this is relatively complex programand the classes are extensively interrelatedso you'll need to peruse the entire listing to see how it works there are four classesdataitemnodetree and tree app we'll discuss them in turn the dataitem class objects of this class represent the data items stored in nodes in real-world program each object would contain an entire personnel or inventory recordbut here there' only one piece of dataof type doubleassociated with each dataitem object the only actions that objects of this class can perform are to initialize themselves and display themselves the display is the data value preceded by slash/ (the display routine in the node class will call this routine to display all the items in node the node class the node class contains two arrayschildarray and itemarray the first is four cells long and holds references to whatever children the node might have the second is three cells long and holds references to objects of type dataitem contained in the node note that the data items in itemarray comprise an ordered array new items are addedor existing ones removedin the same way they would be in any ordered array (as described in "arrays"items may need to be shifted to make room to insert new item in order or to close an empty cell when an item is removed we've chosen to store the number of items currently in the node (numitemsand the node' parent (parentas fields in this class neither of these is strictly necessaryand could be eliminated to make the nodes smaller howeverincluding them clarifies the programmingand only small price is paid in increased node size various small utility routines are provided in the node class to manage the connections to child and parent and to check if the node is full and if it is leaf howeverthe major work is done by the finditem()insertitem()and removeitem(routines these