该文被密码保护。 阅读全文
摘要:
思想:要查找 lca(u,v)dfs到两个结点入栈动作:建立自己的集合,代表元(祖先)为自己出栈动作:合并自己集合到父结点集合(祖先为父结点)注意到一个结点必先入栈,接着另一个结点入栈,设u先发现,v后发现则发现v后,u为黑结点(已经出栈)或灰结点(已经入栈,但未出栈)发现v时,栈中所有灰结点为v的祖先路径若此时u为灰,则lca(u,v)为u,等于u的代表元(因为u未出栈,集合没有向父结点合并)若此时u为黑,则此时u所在集合的代表元就是lca(u,v),且是此时栈中一个灰结点这个文章图文并茂一看就懂:http://scturtle.is-programmer.com/posts/30055ta 阅读全文
该文被密码保护。 阅读全文
摘要:
http://docs.python.org/release/1.5.1p1/tut/keywordArgs.html4.7.2 Keyword ArgumentsFunctions can also be called using keyword arguments of the form "keyword=value". For instance, the following function:def parrot(voltage, state='a stiff', action='voom', type='Norwegian B 阅读全文
摘要:
Detailed DescriptionThe QObject class is the base class of all Qt objects.QObject is the heart of the QtObject Model. The central feature in this model is a very powerful mechanism for seamless object communication calledsignals and slots. You can connect a signal to a slot withconnect() and destroy 阅读全文