A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59). Each LED represents ...
分类:
其他好文 时间:
2017-07-18 00:05:11
阅读次数:
147
题目: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthe ...
分类:
编程语言 时间:
2017-07-17 23:45:28
阅读次数:
212
题目: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tre ...
分类:
编程语言 时间:
2017-07-17 22:04:12
阅读次数:
190
Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tree could be any binary tree? Would your previous solution sti ...
分类:
其他好文 时间:
2017-07-17 09:58:00
阅读次数:
164
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree [3 ...
分类:
其他好文 时间:
2017-07-17 09:57:27
阅读次数:
206
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its ne ...
分类:
其他好文 时间:
2017-07-17 09:54:43
阅读次数:
174
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowes ...
分类:
其他好文 时间:
2017-07-17 09:53:19
阅读次数:
215
Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tree [1,null,2,3], 1 \ 2 / 3 return [1,3,2]. Note: Re ...
分类:
其他好文 时间:
2017-07-16 23:33:03
阅读次数:
224
Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example,Given n = 3, there are a total of 5 unique BST' ...
分类:
其他好文 时间:
2017-07-16 22:39:47
阅读次数:
179
Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical a ...
分类:
其他好文 时间:
2017-07-16 22:34:02
阅读次数:
105