- 博客(12)
- 资源 (11)
- 收藏
- 关注
原创 Symmetric Tree
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \3 4 4 3But the f
2013-07-22 17:15:42 797
原创 Binary Tree Level Order Traversal II
Binary Tree Level Order Traversal IIGiven a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example
2013-07-22 16:58:12 1361
原创 Convert Sorted Array to Binary Search Tree
Convert Sorted Array to Binary Search TreeGiven an array where elements are sorted in ascending order, convert it to a height balanced BST. /** * Definition for binary tree * struct TreeNode
2013-07-22 16:37:57 822
原创 Convert Sorted List to Binary Search Tree
Convert Sorted List to Binary Search TreeOct 3 '123397 / 9589Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 刚开始想用课本上的构造平衡二叉树的方法
2013-07-22 16:27:45 644
原创 Minimum Depth of Binary Tree
Minimum Depth of Binary TreeOct 10 '124568 / 11410Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the near
2013-07-18 14:22:13 1661
原创 Path Sum II
Path Sum IIOct 14 '123844 / 10801Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and sum = 22,
2013-07-18 14:03:53 1329
原创 Path Sum
Path SumOct 14 '124097 / 9547Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Giv
2013-07-18 11:57:55 2199
原创 Flatten Binary Tree to Linked List
Flatten Binary Tree to Linked List Oct 14 '124412 / 13068Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \
2013-07-18 11:45:43 3122
原创 Distinct Subsequences
Distinct SubsequencesOct 19 '123689 / 10619Given a string S and a string T, count the number of distinct subsequences ofT in S.A subsequence of a string is a new string which is formed from th
2013-07-18 09:49:05 1446
原创 Populating Next Right Pointers in Each Node II
Populating Next Right Pointers in Each Node IIOct 28 '123191 / 7859Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would yo
2013-07-17 17:28:23 1487
原创 Populating Next Right Pointers in Each Node
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointer to point to its next right node. If t
2013-07-17 15:59:52 681
原创 C++ 位对齐操作
看到一个宏 : #define PAD_ALIGN(x, mask) ((x + mask)&~mask) 首先要了解对齐操作,就是指位数不够y的倍数时最后用一个y的补齐。例如:12不是8的倍数,如果对8对齐,则位数应该为16。 应用的话,在图像的存储上有应用,例如24位图在存储时行的位数应为32的倍数。再看这个宏,就明朗了。如若x的后mask(00011111,1的个数)位有1存在(
2013-07-08 09:59:52 1930
英文版蓝宝书 opengl
2013-10-21
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人