Python论坛  - 讨论区

标题:答复: [python-chinese]Python没有指针,怎么实现树和链表的结构?

2004年08月11日 星期三 08:43

黎达文 ldw at suntektech.com
Wed Aug 11 08:43:00 HKT 2004

.^_^。认识有局限啊 

-----邮件原件-----
发件人: python-chinese-bounces at lists.python.cn
[mailto:python-chinese-bounces at lists.python.cn] 代表 guochen
发送时间: 2004年8月10日 14:35
收件人: python-chinese at lists.python.cn
主题: Re: [python-chinese]Python没有指针,怎么实现树和链表的结构?

黎达文,您好!

	废话
要是能预知大小,谁还要用树

======= 2004-08-10 14:28:00 您在来信中写道:=======

>这要看实际情况的,如果树的大小本来就是固定的,我们干嘛还要动态存储结构呢?
>
>-----邮件原件-----
>发件人: python-chinese-bounces at lists.python.cn
>[mailto:python-chinese-bounces at lists.python.cn] 代表 guochen
>发送时间: 2004年8月10日 13:00
>收件人: gentoo.cn at 126.com, python-chinese at lists.python.cn
>主题: Re: [python-chinese]Python没有指针,怎么实现树和链表的结构?
>
>gentoo.cn,您好!
>
>	怕的就是用数组
>完全没办法控制大小
>
>======= 2004-08-10 11:58:00 您在来信中写道:=======
>
>>C++不用指针没法实现树吗?
>>同理,Python中使用C++中不用指针的树的算法不就可以了吗
>>提示:使用数组的树
>>
>>Jacob Fan wrote:
>>
>>>实现树和链表不需要指针,只要引用就可以了.所谓Python,Java一类的语言中没有指
>针是指你不能得到一个数据的确切的地址,不能做指针运算等等 不是说你不能引用另
外
>一个对象.
>>>
>>>class LinkedListNode:
>>>    def __init__(self, nextNode):
>>>        self.nextNode = nextNode
>>>
>>>----- Original Message -----
>>>From: "limodou" <chatme at 263.net>
>>>To: <python-chinese at lists.python.cn>
>>>Sent: Tuesday, August 10, 2004 11:38 AM
>>>Subject: Re: [python-chinese] Python没有指针,怎么实现树和链表的结构?
>>>
>>>
>>>  
>>>
>>>>guochen,您好!
>>>>
>>>>使用对象啊。对象可以是任意的东西啊。
>>>>
>>>>a = [1,2,[3,4,[5,6]]]
>>>>
>>>>这样不就和链表一样吗?树也可以这样表示啊。
>>>>
>>>>======= 2004-08-10 11:15:39 您在来信中写道:=======
>>>>
>>>>    
>>>>
>>>>>python-chinese,您好!
>>>>>
>>>>>
>>>>>
>>>>>        致
>>>>>礼!
>>>>>
>>>>>
>>>>>        guochen
>>>>>        guochen at 1218.com.cn
>>>>>          2004-08-10
>>>>>
>>>>>
>>>>>_______________________________________________
>>>>>python-chinese list
>>>>>python-chinese at lists.python.cn
>>>>>http://python.cn/mailman/listinfo/python-chinese
>>>>>      
>>>>>
>>>>= = = = = = = = = = = = = = = = = = = =
>>>>
>>>>
>>>>        致
>>>>礼!
>>>> 
>>>>
>>>>        limodou
>>>>        chatme at 263.net
>>>>          2004-08-10
>>>>
>>>>
>>>>    
>>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>-
>>>----------
>>>
>>>
>>>  
>>>
>>>>_______________________________________________
>>>>python-chinese list
>>>>python-chinese at lists.python.cn
>>>>http://python.cn/mailman/listinfo/python-chinese
>>>>    
>>>>
>>>>--------------------------------------------------------------------
>>>>-
>>>>---
>>>>
>>>>_______________________________________________
>>>>python-chinese list
>>>>python-chinese at lists.python.cn
>>>>http://python.cn/mailman/listinfo/python-chinese
>>>>    
>>>>
>>
>>_______________________________________________
>>python-chinese list
>>python-chinese at lists.python.cn
>>http://python.cn/mailman/listinfo/python-chinese
>
>= = = = = = = = = = = = = = = = = = = =
>			
>
>        致
>礼!
> 
>				 
>        guochen
>        guochen at 1218.com.cn
>          2004-08-10
>
>
>
>_______________________________________________
>python-chinese list
>python-chinese at lists.python.cn
>http://python.cn/mailman/listinfo/python-chinese
>
>_______________________________________________
>python-chinese list
>python-chinese at lists.python.cn
>http://python.cn/mailman/listinfo/python-chinese

= = = = = = = = = = = = = = = = = = = =
			

        致
礼!
 
				 
        guochen
        guochen at 1218.com.cn
          2004-08-10



_______________________________________________
python-chinese list
python-chinese at lists.python.cn
http://python.cn/mailman/listinfo/python-chinese


[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号