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 displayif there were full items per nodethere would be 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 coursethis 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 program is relatively complexand 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 the dataitem 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 longassociated 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 orderor to close an empty cell when an item is removed