题目描述 Farmer John has gone to town to buy some farm supplies. Being a very efficient man, he always pays for his goods in such a way that the smallest ...
分类:
其他好文 时间:
2018-04-10 21:56:10
阅读次数:
292
给定一个二叉搜索树,编写一个函数kthSmallest来查找其中第k个最小的元素。 注意:你可以假设k总是有效的,1≤ k ≤二叉搜索树元素个数。 进阶:如果经常修改二叉搜索树(插入/删除操作)并且你需要频繁地找到第k小值呢? 你将如何优化kthSmallest函数? 详见:https://leet ...
分类:
其他好文 时间:
2018-04-09 13:23:15
阅读次数:
212
Some useful API Attr .attr() vs .prop() : "difference" attr() retrieve property values may cause inconsistent behaviour, but .prop() will not. .toggle ...
分类:
Web程序 时间:
2018-04-06 22:38:28
阅读次数:
214
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_3_B For a given array a1,a2,a3,...,aNa1,a2,a3,...,aN of NN elements and an integer KK, fi ...
dist packages 和 site packages的区别 Reference: https://stackoverflow.com/questions/9387928/whats the difference between dist packages and site packages 总 ...
分类:
其他好文 时间:
2018-04-03 12:47:02
阅读次数:
137
创建一个函数,接受两个或多个数组,返回所给数组的 对等差分(symmetric difference) (△ or ⊕)数组. 给出两个集合 (如集合 A = {1, 2, 3} 和集合 B = {2, 3, 4}), 而数学术语 "对等差分" 的集合就是指由所有只在两个集合其中之一的元素组成的集合 ...
分类:
其他好文 时间:
2018-04-01 13:18:27
阅读次数:
141
What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'? A terminal is at the end of an electric wire A shell is the hom ...
分类:
系统相关 时间:
2018-03-30 23:06:50
阅读次数:
419
集合 特性: a.确定性(元素必须可以hash) b.互异性(去重) c.无序性(集合中的元素没有先后之分) 集合关系测试 交集 & jihe1.intersection(jihe2) 差集 jihe1.difference(jihe2) 并集 | jihe1.union(jihe2) 对称差集 ^ ...
分类:
编程语言 时间:
2018-03-29 19:05:30
阅读次数:
194
Given a matrix of size N x M. For each row the elements are sorted in ascending order, and for each column the elements are also sorted in ascending o ...
分类:
其他好文 时间:
2018-03-29 13:27:47
阅读次数:
135
1、Redis简介Redis是一种高级key-value数据库。它跟memcached类似,不过数据可以持久化,而且支持的数据类型很丰富。有字符串,链表,集?合和有序集合。支持在服务器端计算集合的并,交和补集(difference)等,还支持多种排序功能。所以Redis也可以被看成是一个数据结构服务器。
Redis的所有数据都是保存在内存中,然后不定期的通过异步方式保存到磁盘上(这称为
分类:
数据库 时间:
2018-03-29 10:55:55
阅读次数:
230