上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 19 下一页
摘要: 转:http://www.cnblogs.com/easonliu/p/3696135.html 分析:这个问题是google的面试题。由于一个字符串有很多种二叉表示法,貌似很难判断两个字符串是否可以做这样的变换。对付复杂问题的方法是从简单的特例来思考,从而找出规律。先考察简单情况:字符串长度为1: 阅读全文
posted @ 2015-09-01 16:14 linqiaozhou 阅读(580) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then l 阅读全文
posted @ 2015-09-01 15:47 linqiaozhou 阅读(208) 评论(0) 推荐(0) 编辑
摘要: A 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 阅读全文
posted @ 2015-08-31 22:08 linqiaozhou 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 转自:http://blog.csdn.net/enjoyyl/article/details/47397505?from=timeline&isappinstalled=0#10006-weixin-1-52626-6b3bffd01fdde4900130bc5a2751b6d1 NVIDIA D 阅读全文
posted @ 2015-08-28 15:17 linqiaozhou 阅读(1561) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2015-08-27 21:22 linqiaozhou 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 一、stackstack 模板类的定义在<stack>头文件中。stack 模板类需要两个模板参数,一个是元素类型,一个容器类型,但只有元素类型是必要的,在不指定容器类型时,默认的容器类型为deque。定义stack 对象的示例代码如下:stack<int> s1;stack<string> s2; 阅读全文
posted @ 2015-08-27 21:13 linqiaozhou 阅读(913) 评论(0) 推荐(0) 编辑
摘要: Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST. Calling next() will return the n 阅读全文
posted @ 2015-08-25 20:12 linqiaozhou 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example, Given the following matrix: [ [ 阅读全文
posted @ 2015-08-24 20:01 linqiaozhou 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the postorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [3,2,1]. Note: Re 阅读全文
posted @ 2015-08-23 21:14 linqiaozhou 阅读(281) 评论(0) 推荐(0) 编辑
摘要: Populating Next Right Pointers in Each Node I Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } 阅读全文
posted @ 2015-08-21 09:26 linqiaozhou 阅读(182) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 19 下一页