tree data structure

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vivek khurana

    #1

    tree data structure

    Hi! all

    i am a new member on this list. I have to implement
    tree data structure using python. How it can be done
    in python. Is there an existing data structure which
    can be used as tree? I have searched archives and
    manuals but no luck.

    Regards
    VK

    Hug the REALITY ;-)



    Disclaimer
    The facts expressed here belong to everybody, the opinions to me. The distinction is yours to draw...



    _______________ _______________ ____
    Do you Yahoo!?
    Yahoo! Small Business - Try our new resources site!
    Find trusted local service providers for moving, roofing, plumbing, painting, pest control and more, along with expert advice, help and how-tos, tips and recommendations to ensure successful projects.

  • Dan Bishop

    #2
    Re: tree data structure

    vivek khurana wrote:[color=blue]
    > Hi! all
    >
    > i am a new member on this list. I have to implement
    > tree data structure using python. How it can be done
    > in python. Is there an existing data structure which
    > can be used as tree?[/color]

    Tuples can be used as trees: you can let them represent (data,
    left_child, right_child).

    # a binary search tree for the integers 0 to 6
    (3, (1, (0, None, None),
    (2, None, None)),
    (4, (5, None, None),
    (6, None, None)))

    Comment

    Working...