码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
Binary Tree Level Order Traversal II
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class...
分类:其他好文   时间:2015-07-03 19:17:57    阅读次数:134
Balanced Binary Tree
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class...
分类:其他好文   时间:2015-07-03 19:14:07    阅读次数:124
LeetCode练习-求二叉树的深度-Maximu Depth of Binary Tree
题目大意:很简单,只需要找出一颗二叉树的最大深度即可,貌似没有时间和空间的要求。求解方法:更简单,只需要按照宽度优先的方法去查找即可,在这里我用a队列保存待扩展的节点,用b来保存a扩展出来的节点,再利用t中间变量来交换a和b,直到a列队为空时,结束。 注意边界条件,root=NULL时,应该返回0...
分类:其他好文   时间:2015-07-03 19:14:06    阅读次数:110
leetcode | Path Sum
Path Sum :https://leetcode.com/problems/path-sum/ 解析:求根到叶节点路径上所有节点的和等于target的值 即判断是否存在 一个叶节点的值等于target;如何判断一个节点是叶节点:该节点本身非空,左右节点为空。/** * Definition for a binary tree node. * struct TreeNode { *...
分类:其他好文   时间:2015-07-03 17:33:57    阅读次数:109
leetcode | Balanced Binary Tree
Balanced Binary Tree : https://leetcode.com/problems/balanced-binary-tree/given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary...
分类:其他好文   时间:2015-07-03 15:51:33    阅读次数:118
Leetcode 98 Validate Binary Search Tree
Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n...
分类:其他好文   时间:2015-07-03 13:55:42    阅读次数:97
Maximum Depth of Binary Tree
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class...
分类:其他好文   时间:2015-07-03 12:29:21    阅读次数:132
67 Add Binary
67 Add Binary链接:https://leetcode.com/problems/add-binary/ 问题描述: Given two binary strings, return their sum (also a binary string).For example, a = “11” b = “1” Return “100”.Hide Tags Math String求两...
分类:其他好文   时间:2015-07-03 10:42:39    阅读次数:126
Binary Tree Level Order Traversal
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class...
分类:其他好文   时间:2015-07-03 10:37:38    阅读次数:149
项目架构基础之二 ---- 工程中创建静态库文件(.a)库文件
步骤1.创建工程HLStaticTest 步骤2.创建静态库文件 步骤3. 关闭HLStatic,回到HLStaticTest Targets - 》Build Phases ->Link Binary With Libraries 然后进...
分类:其他好文   时间:2015-07-03 09:25:10    阅读次数:213
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!