2015年10月3日

[Leetcode] - 96 Unique Binary Search Trees

摘要: Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. 1... 阅读全文

posted @ 2015-10-03 15:36 tuituji 阅读(151) 评论(0) 推荐(0) 编辑

[LeetCode] 116 - Populating Next Right Pointers in Each Node

摘要: Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe... 阅读全文

posted @ 2015-10-03 11:35 tuituji 阅读(181) 评论(0) 推荐(0) 编辑

[LeetCode] 141 - Linked List Cycle

摘要: Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?/** * Definition for singly-linked list. *... 阅读全文

posted @ 2015-10-03 11:13 tuituji 阅读(109) 评论(0) 推荐(0) 编辑

[LeetCode] 94 - Binary Tree Inorder Traversal

摘要: Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].Note... 阅读全文

posted @ 2015-10-03 10:49 tuituji 阅读(173) 评论(0) 推荐(0) 编辑

导航