上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页
摘要: Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))... 阅读全文
posted @ 2015-03-02 10:52 胡潇 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n... 阅读全文
posted @ 2015-02-28 10:11 胡潇 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x) : val(... 阅读全文
posted @ 2015-02-26 05:06 胡潇 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array A =[1,1,1,2,2,3],Your function should ret... 阅读全文
posted @ 2015-02-25 09:00 胡潇 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:Yo... 阅读全文
posted @ 2015-02-24 03:13 胡潇 阅读(163) 评论(0) 推荐(0) 编辑
摘要: RT 阅读全文
posted @ 2015-02-17 06:27 胡潇 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 题目:Reverse a singly linked list.解题:反转单链表,不再多介绍了.如果会“先条件->定参数->确定不变式->验证后条件”的思维方法,一定会bug free. 1 /** 2 * Definition for singly-linked list. 3 * struc... 阅读全文
posted @ 2015-02-14 06:30 胡潇 阅读(182) 评论(0) 推荐(0) 编辑
摘要: rt 阅读全文
posted @ 2015-02-13 07:52 胡潇 阅读(135) 评论(0) 推荐(0) 编辑
摘要: rt 阅读全文
posted @ 2015-02-12 07:10 胡潇 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 未完成,还可以找到更好的解 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x)... 阅读全文
posted @ 2015-02-11 22:30 胡潇 阅读(161) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页