Leftmost Child Right Sibling - PowerPoint PPT Presentation

1 / 5
About This Presentation
Title:

Leftmost Child Right Sibling

Description:

... reference to its leftmost child and right sibling only. ... O(1) access time to reach any child. ... Leftmost-child-right-sibling representation of a tree ... – PowerPoint PPT presentation

Number of Views:706
Avg rating:3.0/5.0
Slides: 6
Provided by: IRE62
Category:

less

Transcript and Presenter's Notes

Title: Leftmost Child Right Sibling


1
Leftmost Child Right Sibling
  • Irena Pevac
  • CS501

2
General Tree
3
Leftmost Child Right Sibling Representation of
Trees
  • To overcome the space inefficiency of the array
    of references representation of a tree with large
    branching factor (such as the one used in trie)
    we can use linked list to represent the children
    of nodes. That way we reduce significant number
    of null references.
  • Each node has reference to its leftmost child and
    right sibling only.
  • Each leaf has a null for leftmost child and each
    rightmost child has a null for right sibling
    reference.

4
Leftmost-child-right-sibling representation of a
tree
5
Trie and Leftmost-Child-Right-Sibling
Representations
  • Trie requires O(1) access time to reach any
    child. Requires more space due to many null
    references.
  • Leftmost-child-right-sibling representation of a
    tree uses less space.
  • Leftmost-child-right-sibling representation of a
    tree does not limit the branching factor of
    nodes, while in case of trie represented using an
    array for references branching factor is limited.
Write a Comment
User Comments (0)
About PowerShow.com