码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
[LeetCode]Binary Search Tree Iterator,解题报告
题目     LeetCode题目如下: mplement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST. Calling next() will return the next smallest number in the...
分类:其他好文   时间:2015-02-09 21:44:38    阅读次数:206
Nodejs编码转化问题
目前Node.js仅支持hex、utf8、ascii、binary、base64、ucs2几种编码的转换。对于GBK,GB2312等编码,Nodejs自带的toString()方法不支持,因此中文转化的时候需要加载第三方库,主要有两个编码转换库iconv-lite和encoding,个人推荐使用en...
分类:Web程序   时间:2015-02-09 19:57:22    阅读次数:1660
mysql日常语句总结
1 #删除mysql的二进制日志文件2 #将删除mysql-bin.*****1之前的日志文件3 purge binary logs to 'mysql-bin.*****1';4 #重新生成一个二进制日志文件,使日志写入新产生的文件中5 flush logs
分类:数据库   时间:2015-02-09 17:46:31    阅读次数:177
Leetcode_Binary Tree Level Order Traversal
广度遍历二叉树,且要分别记录每一层的数据,方法有二。 1.迭代法 设置两个队列,其中一个队列用于存放上一层的节点,另一个队列用于存放下一层的节点。轮番使用。 class Solution { public: vector > levelOrder(TreeNode *root) { queue q1,q2; vector> result; if(!root) return...
分类:其他好文   时间:2015-02-09 16:03:19    阅读次数:177
leetcode[67]Add Binary
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".class Solution {public:string addBinary(string ...
分类:其他好文   时间:2015-02-09 15:32:50    阅读次数:127
leetcode[87]Scramble String
Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation...
分类:其他好文   时间:2015-02-09 15:31:37    阅读次数:149
03-3. Tree Traversals Again (PAT)
An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the...
分类:其他好文   时间:2015-02-09 15:30:01    阅读次数:124
leetcode[85]Maximal Rectangle
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.class Solution {public:int larges...
分类:其他好文   时间:2015-02-09 15:29:48    阅读次数:125
linux 多个文件中查找字符串
2015年2月9日 14:36:38# find -type f -name "*.c" | xargs grep ""是你要找的文件夹;如果是当前文件夹可以省略-type f 说明,只找文件-name "*.c" 表示只找C语言写的代码,从而避免去查binary;也可以不写,表示找所有文件是你.....
分类:系统相关   时间:2015-02-09 15:24:40    阅读次数:186
leetcode[89]Gray Code
The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total number...
分类:其他好文   时间:2015-02-09 15:22:50    阅读次数:115
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!