Tree2

Tree2

) Include a method that will multiply by three every node of the tree: public void triple() { ... } For example, the tree

                               t =                        3
                                                        /        \
                                                        /        \
                                                      4             5
                                                 /        \       /        \
                                               6           7      8        9

after doing t.triple(); should become 9 / \ / \ 12 15 / \ / \ 18 21 24 27 print("code sample");

View Answers









Related Tutorials/Questions & Answers:
Tree2
Tree2  ) Include a method that will multiply by three every node of the tree: public void triple() { ... } For example, the tree t = 3
Adding Line to JTree
_TO_REPLACE_1 This program creates a box and two trees (tree1 and tree2). These trees...);   JTree tree2 = new JTree();   JScrollPane scroll2 = new JScrollPane(tree2);   box.add
Advertisements

Ads