- 博客(4)
- 收藏
- 关注
原创 [RxJava] 并发之flatMap() VS parallel()
想把之前写的多线程下载文件的库用RxJava重新实现一下,于是看了看在RxJava如何实现并发。首先说一点,RxJava里的subscribeOn以及observeOn这两个Operator仅能用来实现线程切换,其整个数据流及操作还是串行的,没有任何并发的意思。实现办法也就是标题里面的那两个Operator:flatMap()flatMap操作符做了两件事: - map:对每个来...
2018-05-27 19:05:19 2755
原创 [lintCode] 178. Graph Valid Tree
描述https://www.lintcode.com/problem/graph-valid-tree/description Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to check whethe...
2018-05-13 16:01:35 387
原创 [lintcode] 814. Shortest Path in Undirected Graph
Description Give an undirected graph, in which each edge’s length is 1, and give two nodes from the graph. We need to find the length of the shortest path between the given two nodes.Example Given...
2018-05-13 14:24:03 418
原创 [lintcode] 752. Rogue Knight Sven
时隔两年重回LintCode,多了好多题啊,赶紧刷一道找找感觉【题目描述】 https://www.lintcode.com/problem/rogue-knight-sven/descriptionIn material plane “reality”, there are n + 1 planets, namely planet 0, planet 1, …, planet n. E...
2018-05-12 19:52:19 435
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人