并查集 并查集(Union-Find Sets)是一种非常精巧而实用的数据结构,它主要用于处理一些不相交集合的合并问题。一些常见的用途有求连通子图、求最小生成树的 Kruskal 算法和求最近公共祖先(Least Common Ancestors, LCA)等。 并查集的实现原理也比较简单,就是使用 ...
分类:
其他好文 时间:
2016-05-18 21:45:48
阅读次数:
127
求未配对的数(1):
在一组数据中有 只有一个数出现了一次,其余的数都是成对的出现,请找出这个数:这个题很容易解决,只要把这组数据全部异或(相同为零,不同为1),所以出现两次的数异或后就为零,最后剩下的就是出现一次的数。
#include
#include
int find_once_num(int arr[], int len )
{
int num...
分类:
其他好文 时间:
2016-05-18 19:57:55
阅读次数:
153
var j = jquery.noConflict();
让出对变量$的控制权,并将jquery付给别名j
jquery.noConflict(true);让出对变量$和jquery的控制权
jQuery(selector, context)
selector 表示选择器
$(div
$(div).find(div).find(input).eq(0)
context ...
分类:
Web程序 时间:
2016-05-18 19:42:22
阅读次数:
175
题目信息1087. All Roads Lead to Rome (30)时间限制200 ms
内存限制65536 kB
代码长度限制16000 B
Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with...
分类:
其他好文 时间:
2016-05-18 19:32:53
阅读次数:
186
题目链接:https://leetcode.com/problems/duplicate-emails/题目:
Write a SQL query to find all duplicate emails in a table named Person.+—-+———+
| Id | Email |
+—-+———+| 1 | a@b.com |
| 2 | c@d.com |
|...
分类:
其他好文 时间:
2016-05-18 19:13:45
阅读次数:
100
题目链接:https://leetcode.com/problems/customers-who-never-order/题目:
Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL query to find all customers who never...
分类:
其他好文 时间:
2016-05-18 19:12:27
阅读次数:
113
题目链接:https://leetcode.com/problems/consecutive-numbers/题目:
Write a SQL query to find all numbers that appear at least three times consecutively.+—-+—–+
| Id | Num |
+—-+—–+
| 1 | 1 |
| 2 | 1...
分类:
其他好文 时间:
2016-05-18 18:57:14
阅读次数:
135
Hibernate的核心类和接口一共有6个,分别为:Configuration、SessionFactory、Session、Query、Criteria和Transaction。这6个核心类和接口在任何开发中都会用到。通过这些接口,不仅可以对持久化对象进行存取,还能够进行事务控制。其中Query和Criteria是
hiernate 3中对Session 中find方法的取缔。...
分类:
Web程序 时间:
2016-05-18 18:55:14
阅读次数:
164
题目链接:https://leetcode.com/problems/rising-temperature/题目:
Given a Weather table, write a SQL query to find all dates’ Ids with higher temperature compared to its previous (yesterday’s) dates.+———+————...
分类:
其他好文 时间:
2016-05-18 18:55:03
阅读次数:
208
FFMPEG解码流程:
1. 注册所有容器格式和CODEC: av_register_all()
2. 打开文件: av_open_input_file()
3. 从文件中提取流信息: av_find_stream_info()
4. 穷举所有的流,查找其中种类为CODEC_TYPE_VIDEO
5. 查找对应的解码器: avcodec_find_decoder()...
分类:
其他好文 时间:
2016-05-18 18:16:09
阅读次数:
236