Refer to the first-child/next-sibling method for implementing trees, (figure 18)
ID: 3564055 • Letter: R
Question
Refer to the first-child/next-sibling method for implementing trees, (figure 18). Give an analogous last-child/previous-sibling method in which each node stores a link to its last (rightmost, in sibling order) child and another link to its previous (or left) sibling. Depict the implementation of the tree (figure 19) using this method (by analogy with figure 18).
I'm thinking that what the question is asking for, is a diagram depicting a doubly-linked list, using double-ended arrows between nodes? Help would be much appreaciated!
Explanation / Answer
you can store your previous node adrress by using recursion...... recursion powerful hand is backtracking.........
thankyou plz rate..........