QUESTIONS AND ANSWERS 100%
CORRECT!!!!!
(GRADED A+)
, How kira has used abstraction in design of her tree [3] - ANSWER It removes any
unnecessary detail
The actual movements are shown as lines
The tree does not show any information about what the moves are
State why the tree in Fig. 1 is not an example of a binary tree [1] - ANSWER The nodes
arent ordered
State what type of pointers are used to store nodes I, F, J and H so they do not point to
any other nodes [1] - ANSWER null pointers
Kira wants the program to traverse the tree to evaluate the range of possible moves.
She is considering using a breadth-first traversal or a depth-first (post-order) traversal.
Show how a breadth-first traversal would traverse the tree shown in Fig. 1 [4] -
ANSWER Use A as starting node
Then visit the nodes B then C then E
Then visit D then F then G then H
Then finally visit I and J
Kira wants to make some changes to the data that is stored in the tree structure shown
in Fig. 1.
The move represented by node 'E' needs to be deleted.
Describe the steps an algorithm will follow to delete node 'E' from the tree [3] -
ANSWER Search location to find the node E
Create a new node with the value K
Add a pointer from node G to the new node
The move represented by the node 'K' needs to be added. Node 'K' needs to be joined
to node 'G.'
Describe the steps the algorithm will follow to add node 'K' to the right of node 'G' [3] -
ANSWER Search the tree to find the location of node G
Create a new node with value K
Add a pointer from node G to the new node
Give two similarities and two differences between a tree and a graph structure [4] -
ANSWER Both consists of nodes
Both are connected by links