Redian新闻
>
可不可以推荐一本学习Excel/VBA的书?
avatar
可不可以推荐一本学习Excel/VBA的书?# Software - 软件世界
s*r
1
麻省Concord华人家庭诚聘有爱心保姆,照看18个月大的男孩及简单家务,住家通勤均
可。有意者请打617-817-6679,谢谢。
avatar
w*n
2
Wenqing曾经问我,“你的感情经历很复杂么?” 我一直搞不清楚感情到底如何用简单
和复杂来界定的,也许那本来就是件没法界定的事情。我说:“这问题挺难回答的,每
个人对复杂的定义都不一样,比如有人觉得斗地主很复杂,有人觉得挺简单的。我的经
历是不是复杂,有点难说,我自己都有些迷惑,有时候觉得很简单……”
说到这里,wenqing打断了我,“其实我只是想问问你有过几个女朋友。”
我对着屏幕叹了口气,这样的回答肯定给wenqing留下来很罗嗦的印象,女人应该大多
不喜欢罗嗦男人的。本来我不是这么罗嗦,大概是心老了。
我本来说话十分简约明了,记得很久以前,水木上有个女id,上武侠版哭诉男朋友如何
变心,她又是如何离不开他,如今想来,也算是可怜之人。当时我年少轻狂,回帖写了
一句话,“去死,要么活着。”当时刚看过《活着》,觉得人生纠缠在一个移情别恋的
人身上,哪怕浪费一分钟,也不值得。回这句话的意思是,如果还清楚的知道自己不会
因此而死,那么最好不要浪费时间和感情了。
很不幸的是,没人能从那六个字领会出我的本意,现在想来,即便我自己看见那六个字
,也会无名火起,骂一句毫无人性了。当时论坛上的
avatar
d*n
3
/* Inserts the node pointed to by "newNode" into the subtree rooted at "tre
eNode" */
void InsertNode(Node *&treeNode, Node *newNode)
{
if (treeNode == NULL)
treeNode = newNode;
else if (newNode->key < treeNode->key)
InsertNode(treeNode->left, newNode);
else
InsertNode(treeNode->right, newNode);
}
The above "destructive" procedural variant modifies the tree in place. It us
es only constant space, but the previous version of the tree is lost.
我不懂为什么是destructive
avatar
d*n
4
谢谢!
avatar
l*d
5
"destructive" = previous version of the tree is lost
the code seems ok to me.
maybe if you give the other variant method of inserting nodes which is not "
in place", we will know what the author really means by "destructive"
avatar
d*n
6
thanks.
http://en.wikipedia.org/wiki/Binary_search_tree#Insertion

"

【在 l*****d 的大作中提到】
: "destructive" = previous version of the tree is lost
: the code seems ok to me.
: maybe if you give the other variant method of inserting nodes which is not "
: in place", we will know what the author really means by "destructive"

avatar
l*d
7
ok, by "destructive" is means you destroy the previous state, i.e., after
you insert the node, you only know the present state (after node insertion),
and you have no idea about the previous state (before node insertion). in
other words, you don't know which node you have inserted.
although I don't understand how does the python script preserve all previous
states since I don't know python.

【在 d****n 的大作中提到】
: thanks.
: http://en.wikipedia.org/wiki/Binary_search_tree#Insertion
:
: "

avatar
d*n
8
但是只是改变了一个node的null指针啊, 怎么能说是destructive呢?

),
previous

【在 l*****d 的大作中提到】
: ok, by "destructive" is means you destroy the previous state, i.e., after
: you insert the node, you only know the present state (after node insertion),
: and you have no idea about the previous state (before node insertion). in
: other words, you don't know which node you have inserted.
: although I don't understand how does the python script preserve all previous
: states since I don't know python.

avatar
l*d
9
you "destroyed" the previous state

【在 d****n 的大作中提到】
: 但是只是改变了一个node的null指针啊, 怎么能说是destructive呢?
:
: ),
: previous

avatar
d*n
10
but the following condition is still satisfied:
"any reference to the original tree root remains valid"

【在 l*****d 的大作中提到】
: you "destroyed" the previous state
avatar
l*d
11
dependes on how the author defines "destructive"

【在 d****n 的大作中提到】
: but the following condition is still satisfied:
: "any reference to the original tree root remains valid"

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。