473,569 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to use Data Structure (such as Tree,link list) by Python?

as title
Jul 18 '05 #1
3 1687
ivy
Python has built-in list and search tree.
If you like , you can write it by yourself.
Jul 18 '05 #2

"ivy" <iv*@doramail.c om> wrote:

Python has built-in list and search tree.
If you like , you can write it by yourself.


Python does not come with a tree data structure. It does come with a
'dictionary', which is implemented as a hash table.

- Josiah

Jul 18 '05 #3
thanks......
I use list intead tree
use pop() and append()....(St ack)
"Josiah Carlson" <jc******@uci.e du>
???????:ma***** *************** *************** ***@python.org. ..

"ivy" <iv*@doramail.c om> wrote:

Python has built-in list and search tree.
If you like , you can write it by yourself.


Python does not come with a tree data structure. It does come with a
'dictionary', which is implemented as a hash table.

- Josiah

Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
7942
by: Jeffrey Silverman | last post by:
Hi, all. I have a linked list. I need an algorithm to create a tree structure from that list. Basically, I want to turn this: $list = array( array( 'id' => 'A', 'parent_id' => null, 'value' => 'aaa') , array( 'id' => 'B', 'parent_id' => 'A', 'value' => 'bbb') , array( 'id' => 'C', 'parent_id' => 'B', 'value' => 'ccc') , array( 'id' =>...
3
5353
by: Ksenia Marasanova | last post by:
I get this kind of list from a database. (The tuple structure is: id, name, parent_id) I would like to transfer it (in Python) into a tree structure. I don't care much about format, as long as I'll be able to get all the information, based on one id. For example, if I have id=3, I want to get - name ('otherparent')
1
2145
by: vivek khurana | last post by:
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
30
3365
by: Charles Law | last post by:
Here's one that should probably have the sub-heading "I'm sure I asked this once before, but ...". Two users are both looking at the same data, from a database. One user changes the data and commits it. How does the other user get the updated view without polling for changes? Is there some sort of callback mechanism that can be set up on...
1
1416
by: noro | last post by:
Hello again. I have a task i need to do and i can't seem to find an elegent solution. i need to make a tree like data structure (not necessry a binary tree). i would like each node to access his sons in a dicionary kind of why, for example: if ROOT node has the name 'A' and 'AA', 'AB' are his sons, and 'ABA' is 'AB son etc' (in this...
11
3749
by: efrat | last post by:
Hello, I'm planning to use Python in order to teach a DSA (data structures and algorithms) course in an academic institute. If you could help out with the following questions, I'd sure appreciate it: 1. What exactly is a Python list? If one writes a, then is the complexity Theta(n)? If this is O(1), then why was the name "list" chosen? If...
10
5944
by: Will Honea | last post by:
I have a data set which I need to analyze but I am having a problem figuring out a structure for the database - or whether there are better ways of attacking the problem. The base data set is a large number of replies to a survey questionaire. I have adapted a NLP program to produce lexically annotated structural trees which appear to...
4
1845
by: Alexander Adam | last post by:
Hello folks, I got a few question on some basic data structure stuff. Sorry if those questions might sound too easy or such but after googling a lot I didn't find a real answer to all those questions so appreciate any help. I need to keep a very efficient data-tree structure (parent, previous, next, first child, last child) within the...
8
1789
by: =?ISO-8859-1?Q?m=E9choui?= | last post by:
Problem: - You have tree structure (XML-like) that you don't want to create 100% in memory, because it just takes too long (for instance, you need a http request to request the information from a slow distant site). - But you want to be able to request data from it, such has "give me all nodes that are under a "//foo/bar" tree, and have a...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7679
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6287
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3657
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2117
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.