class Solution: def addBinary(self, a, b): """ :type a: str :type b: str :rtype: str """ a, b = int(a, 2), int(b, 2) return bin(a + b)[2:] i = Solutio ...
分类:
编程语言 时间:
2018-10-17 14:50:21
阅读次数:
122
Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a ...
分类:
其他好文 时间:
2018-10-17 14:30:32
阅读次数:
173
mongodb操作文件,主要是通过GridFS类。存储文件主要存放在fs中,其中的fs是数据库默认的。并且GridFS是直接与数据库打交道,与collection集合无关。 由于MongoDB的文档结构为BJSON格式(BJSON全称:Binary JSON),而BJSON格式本身就支持保存二进制格 ...
分类:
数据库 时间:
2018-10-17 11:05:16
阅读次数:
149
一、题目 1、审题 2、分析 给出一棵二分查找树的根节点。实现 next() 方法返回下一个最小的二叉树的节点值。 hasNext() 判断是否还有值。 二、解答 1、思路: 采用一个 Stack 存储二叉查找树的左斜子树节点值。 next() 方法返回栈顶节点值,并将其右孩子的左斜子树入栈即可。 ...
分类:
其他好文 时间:
2018-10-16 21:56:14
阅读次数:
139
字符类型 官网解释如下: 验证: 验证之前了解两个函数: 1.char填充空格来满足固定长度,但是在查询时却会很不要脸地删除尾部的空格(装作自己好像没有浪费过空间一样),然后修改sql_mode让其现出原形。 总结: 枚举类型和集合类型 字段的值只能在给定范围中选择,如单选框,多选框 enum 单选 ...
分类:
其他好文 时间:
2018-10-16 17:36:18
阅读次数:
198
Filesystem Hierarchy Standard(FHS) /:根目录,所有的目录、文件、设备都在/之下,/就是Linux文件系统的组织者,也是最上级的领导者。 /bin:bin 就是二进制(binary)英文缩写。在一般的系统当中,都可以在这个目录下找到linux常用的命令。系统所需要的 ...
分类:
系统相关 时间:
2018-10-16 13:51:03
阅读次数:
175
Given a binary tree, count the number of uni-value subtrees. A Uni-value subtree means all nodes of the subtree have the same value. For example:Given ...
分类:
其他好文 时间:
2018-10-16 10:19:11
阅读次数:
193
Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Example 1: Example 2: Follow up: A ...
分类:
其他好文 时间:
2018-10-16 10:19:01
阅读次数:
141
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representati ...
分类:
其他好文 时间:
2018-10-16 10:16:48
阅读次数:
174
Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the roo ...
分类:
其他好文 时间:
2018-10-16 10:15:28
阅读次数:
311