??, definitely not a computer geek :)
所有跟贴
·
加跟贴
·
新语丝读书论坛
送交者: xj 于 2008-02-07, 23:10:34:
回答:
俺是这么想的
由 queue 于 2008-02-07, 22:15:41:
This problem is a basic data structure stuff. You only need to remember root, direct parents and children, and sort by time (actually post ID) for each layer. It is not a big work anyway.
check the source of this file.
所有跟贴:
layer太多,搜索或populate或refresh的时候花时间。 (无内容)
-
queue
(0 bytes)
2008-02-08, 01:03:59
(204048)
就像recursive function一样,层数越多就越慢。
-
queue
(38 bytes)
2008-02-08, 01:14:37
(204049)
就论坛这排帖子而言,不需要recursive function
-
xj
(212 bytes)
2008-02-08, 11:46:47
(204098)
俺只是举recursive function做例子,并没有说要用recursive function
-
queue
(301 bytes)
2008-02-08, 12:55:50
(204114)
其实这东西没你想象得那么复杂。程序只在发帖的时候更新
-
xj
(251 bytes)
2008-02-08, 13:16:10
(204121)
斯蒂文大哥都在提醒你,你还没当回事
-
queue
(309 bytes)
2008-02-08, 13:36:53
(204123)
新警察吧。俺啥也不是。一文科生,理科业余爱好者。:)
-
xj
(42 bytes)
2008-02-08, 13:09:40
(204119)
the only algorithm to mock recursive function is recursive function. (无内容)
-
steven
(0 bytes)
2008-02-08, 02:02:14
(204051)
if prior states are to be remembered. (无内容)
-
steven
(0 bytes)
2008-02-08, 02:07:14
(204053)
1. recursive functions are not efficient 2. 1x2=2x1, if you know what I mean (无内容)
-
008
(0 bytes)
2008-02-08, 01:46:55
(204050)
What else can you do? if the problem is inherently recursive, Like qsort? (无内容)
-
steven
(0 bytes)
2008-02-08, 02:06:12
(204052)
1. recursion should be avoided for trees. 2. "层数越多就越慢" is
-
008
(355 bytes)
2008-02-08, 02:39:56
(204054)
I was trying to guide them to the difference between recursive
-
steven
(269 bytes)
2008-02-08, 15:40:46
(204147)
by using a bookkeeping stack data structure
-
wasguru
(111 bytes)
2008-02-08, 15:08:42
(204139)
how do you avoid recursion when you deal with tree? (无内容)
-
steven
(0 bytes)
2008-02-08, 10:10:19
(204081)
加跟贴
笔名:
密码:
注册笔名请按这里
标题:
内容: (
BBCode使用说明
)