Implement a tree data structure

Implement a tree data structure using Javascript. A. Tree data structure should be a tree of simple nodes with id number, arbitrary number of children. B. Set of basic methods/procedures such as: create_root, add_node, delete_node,search_node, etc. C. Extend the node structure to contain a graphic element like a window, line, label, rectangle, point, etc. We will call these graphic nodes. Different graphic elements will need different attributes (only include the very basic ones). A. Modify the tree ADT so that the graphic nodes can be managed and one can create/add/delete/search different types of graphic nodes. B. Be able to render the graphic elements in the whole tree. C. Write a short program to demonstrate you can construct a tree with graphic nodes and render them on the web browser canvas. Further extend the tree-graphics program in the following way. Write and demonstrate a routine that takes a mouse input and identifies the object that is clicked (e.g. print message or highlight the object, see below). If there are multiple objects that correspond to the location of the mouse click, the lowest in the tree must be identified. In order to do this, one will have to define the rectangular areal dimension of the GUI object (see figure next page). When there are multiple overlapping GUI objects, the lowest level object should be the one selected. Also note that the objects are now interactable.

Pssst…We can write an original essay just for you.

Any essay type. Any subject. We will even overcome a 6 hour deadline.

<< SAVE15 >>

Place your first order with code to get 15% discount right away!

Impressive sample results