Every non-negative integer N has a binary representation. For example, 5 can be represented as "101" in binary, 11 as "1011" in binary, and so on. Not ...
分类:
其他好文 时间:
2019-03-18 01:12:18
阅读次数:
163
"https://github.com/xieqing/avl tree" An AVL Tree Implementation In C There are several choices when implementing AVL trees: store height or balance f ...
分类:
其他好文 时间:
2019-03-17 23:13:54
阅读次数:
128
1. 二叉树 二叉树(Binary Tree)是含有n个结点的有限集合,当n = 0时称为空二叉树。在非空二叉树中: 有且仅有一个称为根的结点 其余结点划分为两个互不相交的子集 L 和 R, 其中 L 和 R 也是一棵二叉树,分别称为左子树和右子树。 有且仅有一个称为根的结点 其余结点划分为两个互不 ...
分类:
其他好文 时间:
2019-03-17 23:05:59
阅读次数:
248
#coding=utf-8# Definition for a binary tree node.class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None# 递归cla ...
分类:
其他好文 时间:
2019-03-17 14:04:32
阅读次数:
179
"题目" 生成函数就是好,什么题目都能搞 先来列一个暴力$dp$,$dp_i$表示形成$i$点权的二叉树的方案数 我们可以直接列出方程 $$ dp_i=\sum_{k=1}^n\sum_{j=0}^{i c_k}dp_jdp_{i c_k j} $$ 边界条件$dp_0=1$ 发现里面类似卷积,于是 ...
分类:
其他好文 时间:
2019-03-17 13:37:36
阅读次数:
160
[toc] 题目链接 "Binary Tree Level Order Traversal LeetCode" 注意点 不要访问空结点 解法 解法一:递归,level表示深度,如果当前ret.size()等于深度,就说明到了一个新的深度。用level访问不同的深度。 解法二:非递归,queue里面存 ...
分类:
其他好文 时间:
2019-03-16 15:26:56
阅读次数:
179
一、对比 1、utf8_general_ci 不区分大小写, utf8_general_cs 区分大小写 2、utf8_bin: compare strings by the binary value of each character in the string 将字符串每个字符串用二进制数据编译 ...
分类:
数据库 时间:
2019-03-16 09:16:46
阅读次数:
237
引擎指的是一个系统的核心部分引擎有不同分类是为了适应不同的使用场景查看mysql支持的所有引擎show enginesMRG_MYISAM 是一堆MYISAM表的集合 用于做水平分表,如果一个表中数据量太大 将导致效率降低 水平分表就是把整个大表拆成不同的小表,每一次查询会先判断数据在哪一个表中 然 ...
分类:
其他好文 时间:
2019-03-15 17:36:48
阅读次数:
148
Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: Solution1: class Solution { public List<String> bina ...
分类:
其他好文 时间:
2019-03-15 16:01:47
阅读次数:
157
binary search tree,中文翻译为二叉搜索树、二叉查找树或者二叉排序树。简称为BST ...
分类:
其他好文 时间:
2019-03-15 16:00:15
阅读次数:
167