n位二进制,求不包含连续1的二进制(n位)数字个数。 http://www.geeksforgeeks.org/count-number-binary-strings-without-consecutive-1s/ 也可以令f[i],表示共i位的二进制数字中,不包含连续1的二进制(i位)数字的个数。 ...
分类:
其他好文 时间:
2017-05-29 11:10:27
阅读次数:
397
一.题目 Maximum Depth of Binary Tree Total Accepted: 70693 Total Submissions: 156776My Submissions Given a binary tree, find its maximum depth. The maxim ...
分类:
其他好文 时间:
2017-05-29 10:02:05
阅读次数:
245
Problem statement: Given a positive integer n, find the number of non-negative integers less than or equal to n, whose binary representations do NOT c ...
分类:
其他好文 时间:
2017-05-29 09:52:27
阅读次数:
154
/** * Definition for a binary tree node. * public class TreeNode { * public int val; * public TreeNode left; * public TreeNode right; * public TreeNod... ...
分类:
其他好文 时间:
2017-05-29 01:00:30
阅读次数:
289
MySQL基础———数据类型 整型类型: 根据所储存的整数数值取值范围不同,可分为以下五类: (1)tinyint 占1个字节 (2)smallint 占2个字节 (3)mediumint 占3个字节 (4)int 占4个字节 ... ...
分类:
数据库 时间:
2017-05-28 22:36:05
阅读次数:
325
MongoDB数据模型和索引学习总结 1. MongoDB数据模型: MongoDB数据存储结构: MongoDB针对文档(大文件採用GridFS协议)採用BSON(binary json,採用二进制编码)数据格式来存储和交换数据。Bson吸收了JSON schema-less的特点,存储结构松散, ...
分类:
数据库 时间:
2017-05-28 13:27:25
阅读次数:
286
集合框架 包含三块内容 对外的接口 ,接口的实现和对集合运算的算法。 一 集合 和数组的区别: 1.数组声明元素的类型,而集合不声明。 2.数组声明之后有固定的大小。一旦生成无法改变。而集合是可以改变大小的, 集合提供了更多的成员方法,能满足更多的需求。 3.数组无论是效率还是检查类型都是最好的。 ...
分类:
编程语言 时间:
2017-05-27 21:54:46
阅读次数:
274
题目: Given 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 neare ...
分类:
编程语言 时间:
2017-05-27 19:09:23
阅读次数:
154
附一篇经典翻译,学习 树状数组 http://www.hawstein.com/posts/binary-indexed-trees.html /** * @author johnsondu * @time 2015-8-22 * @type 2D Binary Index Tree * @stra ...
分类:
编程语言 时间:
2017-05-27 10:52:37
阅读次数:
202
Comparable接口: 此接口强行对实现它的每个类的对象进行整体排序。这种排序被称为类的自然排序,类的 compareTo 方法被称为它的自然比较方法。 实现此接口的对象列表(和数组)可以通过 Collections.sort(和 Arrays.sort)进行自动排序。 方法:int compa ...
分类:
其他好文 时间:
2017-05-27 00:50:59
阅读次数:
259