![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
s亮
这个作者很懒,什么都没留下…
展开
-
Binary Tree Preorder Traversal
二叉树的非递归先序遍历基本思路:从根结点root开始,一直向左子树遍历,在遍历过程中,将节点值依次输出(或者保存在vector中),并且将路径保存在一个栈stack中。遍历到最左节点后,就判断该节点是否有右子树。若有,就按照上述方法接着遍历该节点的右子树;若没有,则回退到有右子树的节点,进行遍历。 一直到stack为空,遍历遍历。vector preorderT原创 2014-03-03 22:05:42 · 578 阅读 · 0 评论 -
Rotate List
Rotate List Total Accepted: 6052 Total Submissions: 28071My SubmissionsGiven a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5原创 2014-03-03 22:44:10 · 537 阅读 · 0 评论 -
Copy List with Random Pointer
Copy List with Random PointerA linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy o原创 2014-03-06 18:42:30 · 527 阅读 · 0 评论