关于《数据结构导论》
所有跟贴
·
加跟贴
·
新语丝读书论坛
送交者: queue 于 2009-07-29, 16:26:58:
我认为lovecreatesbeauty是错误的
(1)的初始化肯定是必须的,它的用途是清栈。当然比较好的code应该先检查栈是不是空的,如果不是,应该先free栈占用的内存,再ls = NULL;
(2)栈是一个后进先出链,“ls = p;”的作用是把栈的顶端指向最后进栈的数据(也就是参数p)。如果你要做所谓的free栈存储,应该先调用栈函数Pop()把最后进栈的数据弹出来。
所有跟贴:
都是不用c++惹的祸
-
三脚猫
(26 bytes)
2009-07-29, 19:20:28
(350858)
what is 封装? Even C++, a code like this won't work. (无内容)
-
steven
(0 bytes)
2009-07-29, 19:26:20
(350859)
encapsulation. Then the structure should be written in a totally different way. (无内容)
-
三脚猫
(0 bytes)
2009-07-29, 19:27:51
(350860)
They couldn't even handle C, you think they could handle C++?
-
steven
(60 bytes)
2009-07-29, 19:32:50
(350862)
c++ is more natural for such a kind of structure with both data and operation.
-
三脚猫
(328 bytes)
2009-07-29, 19:49:04
(350864)
形参位于程序堆栈上,在调用结束后就gone了。 (无内容)
-
heretic
(0 bytes)
2009-07-29, 17:28:11
(350825)
去学一学C函数是怎么编译成汇编码的。以及Application Binary Interface (ABI) (无内容)
-
heretic
(0 bytes)
2009-07-29, 17:25:41
(350824)
你要去学一学Computer (无内容)
-
heretic
(0 bytes)
2009-07-29, 17:22:52
(350820)
你会C语言吗?写一个Stack的程序,自己在写一个测试程序。 (无内容)
-
heretic
(0 bytes)
2009-07-29, 17:21:21
(350819)
Both of them are working in the financial sector
-
aliastwo
(44 bytes)
2009-07-29, 17:41:04
(350831)
You meant queue and lovecreatesbeauty had been from financial sector? (无内容)
-
steven
(0 bytes)
2009-07-29, 18:32:01
(350844)
I don't know about lovecreatesbeauty
-
aliastwo
(129 bytes)
2009-07-29, 18:47:57
(350851)
Yes I am
-
queue
(44 bytes)
2009-07-29, 18:38:06
(350849)
why the word 'anymore'? - was there a time when it was different (无内容)
-
meiyou
(0 bytes)
2009-07-29, 17:48:35
(350833)
there was a time
-
aliastwo
(45 bytes)
2009-07-29, 18:10:28
(350839)
没看出来。 (无内容)
-
heretic
(0 bytes)
2009-07-29, 18:28:17
(350842)
You don't know it until you need a bailout (无内容)
-
aliastwo
(0 bytes)
2009-07-29, 19:16:05
(350854)
No wonder. But it is not about "clean". It is working or not at all! (无内容)
-
heretic
(0 bytes)
2009-07-29, 17:45:11
(350832)
加跟贴
笔名:
密码:
注册笔名请按这里
标题:
内容: (
BBCode使用说明
)