By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,035 Members | 1,995 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,035 IT Pros & Developers. It's quick & easy.

tree data structure

P: n/a
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!
http://smallbusiness.yahoo.com/resources/
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
vivek khurana wrote:
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?


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)))

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.