码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
!codeforces 538B-Quasi Binary-(思维)
题意:由01两个数字组成的十进制数,加起来等于n,求最少有多少个这样的数字 分析:灵活创新,思维转换;如:415=111+101+101+101+1,不用想什么十进制减法什么的 代码: #include using namespace std; int main() { char a[10]; int i=0,hight=0; while(cin>>a[i]) i++; for(in...
分类:其他好文   时间:2015-07-12 00:22:19    阅读次数:288
Lowest Common Ancestor of a Binary Search Tree
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two...
分类:其他好文   时间:2015-07-11 22:56:23    阅读次数:386
Leetcode & CTCI ---Day 2
Balanced Binary TreeGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tre...
分类:其他好文   时间:2015-07-11 22:49:47    阅读次数:110
[LeetCode] Populating Next Right Pointers in Each Node II
The problem becomes more difficult once the binary tree is not perfect. The idea is still similar to use a level-order traversal. Note that we do not ...
分类:其他好文   时间:2015-07-11 20:02:27    阅读次数:132
[LeetCode] Binary Tree Right Side View
A simple application of level-order traversal. Just push the last node in each level into the result.The code is as follows. 1 class Solution { 2 publ...
分类:其他好文   时间:2015-07-11 20:01:41    阅读次数:107
Binary Tree Level Order Traversal II
Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For exa...
分类:其他好文   时间:2015-07-11 19:55:47    阅读次数:177
[LeetCode] Lowest Common Ancestor of a Binary Search Tree
Lowest Common Ancestor of a Binary Search TreeGiven a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.Ac...
分类:其他好文   时间:2015-07-11 18:21:07    阅读次数:121
【LeetCode】235. Lowest Common Ancestor of a Binary Search Tree (2 solutions)
Lowest Common Ancestor of a Binary Search TreeGiven a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.Ac...
分类:其他好文   时间:2015-07-11 18:03:46    阅读次数:137
Lowest Common Ancestor of a Binary Search Tree
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined betw...
分类:其他好文   时间:2015-07-11 16:51:07    阅读次数:126
LeetCode: Lowest Common Ancestor of a Binary Search Tree 解题报告
https://leetcode.com/submissions/detail/32662938/Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST...
分类:其他好文   时间:2015-07-11 16:19:19    阅读次数:98
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!