95. Unique Binary Search Trees II 使用golang进行阶梯,如果[]int是nil,那么range下来是直接跳过的,所以可以返回[]int{nil},这样可以少了很多逻辑判断。 ...
分类:
其他好文 时间:
2018-07-03 11:36:44
阅读次数:
121
原题网址:https://www.lintcode.com/problem/binary-tree-paths/description 描述 给一棵二叉树,找出从根节点到叶子节点的所有路径。 描述 描述 给一棵二叉树,找出从根节点到叶子节点的所有路径。 给一棵二叉树,找出从根节点到叶子节点的所有路径 ...
分类:
其他好文 时间:
2018-07-02 17:45:08
阅读次数:
144
leetcode周赛,早上起来发现没网,用热点意识模糊的a了三个水题。 1.Lemonade Change 简单模拟题,收到十元用五元钱找回,收到20元时优先用一张10一张5,如果10不够用3张5,如果没有就返回flase(贪心)。 2.All Nodes Distance K in Binary ...
分类:
其他好文 时间:
2018-07-02 01:29:40
阅读次数:
190
原题网址:https://www.lintcode.com/problem/flatten-binary-tree-to-linked-list/description 描述 将一棵二叉树按照前序遍历拆解成为一个假链表。所谓的假链表是说,用二叉树的 right 指针,来表示链表中的 next 指针。 ...
分类:
其他好文 时间:
2018-07-02 00:04:57
阅读次数:
111
binary_search 使用方式 binary_search(区间起始,区间结束后一个,要查找的元素。 lower_bound和upper_bound ...
分类:
其他好文 时间:
2018-06-30 20:52:40
阅读次数:
144
JNI: Java Native Interface Java调用本地代码接口 NDK : Native development Kit 安卓提供的本地开发包,用于编译成.so文件 (linux平台的库文件) ABI :Application binary interface 应用程序二进制接口 , ...
分类:
其他好文 时间:
2018-06-30 17:46:46
阅读次数:
197
Question "696. Count Binary Substrings" Example 1: Example 2: Solution 思路:题目大意是,给一个二进制的字符串,问有多少子串的0个数量等于1的数量且子串中0和1不能交替出现。 Java实现: java public int cou ...
分类:
其他好文 时间:
2018-06-29 23:35:18
阅读次数:
212
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 nearest l ...
分类:
其他好文 时间:
2018-06-29 21:40:47
阅读次数:
155
fstream、ifstream、ofstream是c++中关于文件操作的三个类 fstream类对文件进行读操作和写操作 打开文件 例子: fstream fs("test.txt"); //用文本方式打开一个文件用于读写 fstream fs("test.txt",ios::binary); / ...
分类:
其他好文 时间:
2018-06-29 21:04:44
阅读次数:
168
/bin:!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!bin是Binary的缩写, 这个目录存放着最经常使用的命令。 /boot:这里存放的是启动Linux时使用的一些核心文件,包括一些连接文件以及镜像文件。 /dev :dev是Device(设备)的缩写, 该 ...
分类:
系统相关 时间:
2018-06-29 16:26:23
阅读次数:
211