Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).
For example:
Given binary tr...
分类:
其他好文 时间:
2015-03-16 16:34:14
阅读次数:
107
Given a binary tree, return theinordertraversal of its nodes' values.和preorder是一样的,把左子节点一直压入到栈中,直到没有左子节点为止,然后出栈访问,存储右子节点。 1 vector inorderTraversal(Tr...
分类:
其他好文 时间:
2015-03-15 00:42:02
阅读次数:
111
ac自动机中,如果以trie中的节点为节点,(fail[i],i)为边,可以建立一颗树,该树有如下特点:“节点u是节点v的祖先 当且仅当 u代表的字符串是v代表的字符串的一个后缀”。(u代表的字符串是由根节点到u路径上所有的边代表的字符顺次组合成的,我们记作str(u))。本题中的每一个P都对应tr...
分类:
其他好文 时间:
2015-03-14 16:50:49
阅读次数:
150
标题:Populating Next Right Pointers in Each Node II通过率:31.7%难度:难Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tr...
分类:
其他好文 时间:
2015-03-13 14:00:13
阅读次数:
153
这是一个神奇的命令。
tr的全拼就是translate,即翻译。有趣的是我们可以制定规则进行翻译。用法如下:
tr [option] set1 [set2]
tr从标准输入接受输入,然后将结果打印到标准输出。tr最基本的功能就是替换,将set1的字符集按序对应并替换成set2中的字符集。下面看看tr的参数。
-d 删除其后指定的set1的字符。
-c 取set的补集。
-s...
分类:
系统相关 时间:
2015-03-13 00:24:28
阅读次数:
248
/// /// 解析JSON参数 /// public class JSONParser { JObject jObj = null; public JSONParser(string param) { tr...
分类:
Web程序 时间:
2015-03-12 23:55:40
阅读次数:
168
一: Qstring fileName = QFileDialog::getOpenFileName(this, tr("open file"), " ", tr("Allfile(*.*);;mp3file(*.mp3)"));说明:这样就会产生一个对话框,和系统的资源管理器差不多的。返回的是你选...
分类:
其他好文 时间:
2015-03-12 19:08:07
阅读次数:
1179
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/><me..
分类:
其他好文 时间:
2015-03-12 15:22:44
阅读次数:
110
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head><title>HardSoft-Viewer</title></head>
<body>
<?..
分类:
Web程序 时间:
2015-03-12 15:17:44
阅读次数:
149