D - Broken BST 思路: 二叉搜索树; 它时间很优是因为每次都能把区间缩减为原来的一半; 所以,我们每次都缩减权值区间。 然后判断dis[now]是否在区间中; 代码: ...
分类:
其他好文 时间:
2017-05-11 11:38:48
阅读次数:
161
mybatis使用注解替代xml配置时,遇到判断条件是否为null或者为空时,@Select很难搞定,不知道怎么办? mybatis3中增加了使用注解来配置Mapper的新特性,使用 SelectProvider来动态生成sql。 典型的使用场景 1. 无参数@SelectProvide方法在Map ...
分类:
数据库 时间:
2017-05-10 21:23:14
阅读次数:
616
本博客的代码的思想和图片参考:好大学慕课浙江大学陈越老师、何钦铭老师的《数据结构》 Complete Binary Search Tree 1 Question A Binary Search Tree (BST) is recursively defined as a binary tree wh ...
分类:
其他好文 时间:
2017-05-10 20:36:58
阅读次数:
267
Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. Example: Input: 1 \ 3 / 2 O ...
分类:
其他好文 时间:
2017-05-10 20:31:13
阅读次数:
143
HTML即Hyper Text Markup Language(超文本标记语言)。 <h1>Hello</h1> 开始标签,结束标签。中间为显示文本。标签属性在开始标签中。 基本标签结构: <html> <!-- 根标签--> <head> <title><title> </head> <body> ...
分类:
Web程序 时间:
2017-05-10 14:45:00
阅读次数:
310
题目: Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains ...
分类:
其他好文 时间:
2017-05-10 11:36:11
阅读次数:
171
postman+newman+jenkins 环境部署 2017年4月27日 14:33 阅读 11 新浪博客 postman+newman+jenkins 环境部署 2017年4月27日 14:33 阅读 11 新浪博客 1.postman: http://itfish.net ...
分类:
其他好文 时间:
2017-05-10 00:21:36
阅读次数:
196
1. 抽象类 语法:public abstract class 类名(){}; 2. 抽象方法 语法:public abstract 返回值类型 方法名(参数列表); 例:public abstract void print(); 注意:抽象方法有abstract修饰,并且抽象方法没有方法体. 3. ...
分类:
其他好文 时间:
2017-05-09 22:29:45
阅读次数:
222
回调函数的定义: 使用回调函数实际上就是在调用某个函数(一般是API函数)时。将自己的一个函数(这个函数为回调函数)的地址作为參数传递给那个函数。而那个函数在须要的时候。利用传递的地址调用回调函数。这时你能够利用这个机会在回调函数中处理消息或完毕一定的操作。 说白了就是将一个你自已的一个函数A的函数 ...
分类:
其他好文 时间:
2017-05-09 19:43:55
阅读次数:
121
1、遍历字符串 SQL中不提供迭代操作,所以要连接一张用来作为遍历指针的表,来实现这个过程 t10中有十条数据,id从1-10。 from子句提供了笛卡尔积,结果表类似于下图 where子句限制pos范围。 ...
分类:
数据库 时间:
2017-05-09 14:52:21
阅读次数:
125