摘要: binary-tree-level-order-traversal binary-tree-level-order-traversal-ii binary-tree-zigzag-level-order-traversal /** * Definition for binary tree * struct TreeNode { * int val; * TreeNod... 阅读全文
posted @ 2017-05-14 23:27 wxquare 阅读(375) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. Given an array where elements are sorted 阅读全文
posted @ 2017-05-14 21:50 wxquare 阅读(676) 评论(0) 推荐(0) 编辑
摘要: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo 阅读全文
posted @ 2017-05-14 17:26 wxquare 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using std::vector; 4 5 struct TreeNode { 6 int val; 7 TreeNode* left; 8 TreeNode* right; 9 TreeNode(int x) : 10 val(x), left(nullptr), ... 阅读全文
posted @ 2017-05-14 14:25 wxquare 阅读(246) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. For example: Given the below binary tree, Return6. 阅读全文
posted @ 2017-05-14 13:36 wxquare 阅读(209) 评论(0) 推荐(0) 编辑