1. Knuth-Morris-Pratt algorithm

    In computer science, the Knuth–Morris–Pratt string-searching algorithm (or KMP algorithm) searches for occurrences of a “word” W within a main “text string” S by employing the observation that when a mismatch occurs, the word itself embodies sufficient information to determine where the next match could begin, thus bypassing re-examination of previously matched characters.

    2018/08/14 ALGO

  2. Bellman–Ford algorithm

    The Bellman–Ford algorithm is an algorithm that computes shortest paths from a single source vertex to all of the other vertices in a weighted digraph. It is slower than Dijkstra’s algorithm for the same problem, but more versatile, as it is capable of handling graphs in which some of the edge weights are negative numbers.

    2018/08/13 ALGO

  3. Minimum Spanning Trees

    A minimum spanning tree (MST) or minimum weight spanning tree is a subset of the edges of a connected, edge-weighted (un)directed graph that connects all the vertices together, without any cycles and with the minimum possible total edge weight. That is, it is a spanning tree whose sum of edge weights is as small as possible. More generally, any edge-weighted undirected graph (not necessarily connected) has a minimum spanning forest, which is a union of the minimum spanning trees for its connected components.

    2018/08/10 ALGO

  4. Fenwick tree

    A Fenwick tree or binary indexed tree is a data structure that can efficiently update elements and calculate prefix sums in a table of numbers. This structure was proposed by Peter Fenwick in 1994 to improve the efficiency of arithmetic coding compression algorithms.

    2018/08/09 ALGO

  5. Floyd-Warshall algorithm

    In computer science, the Floyd–Warshall algorithm is an algorithm for finding shortest paths in a weighted graph with positive or negative edge weights (but with no negative cycles). A single execution of the algorithm will find the lengths (summed weights) of shortest paths between all pairs of vertices. Although it does not return details of the paths themselves, it is possible to reconstruct the paths with simple modifications to the algorithm.

    2018/08/08 ALGO

  6. Promise

    JavaScript语言的最大特点是单线程,也就是说在同一时间内只能执行一个事务。Node.js中为JavaScript语言提供了非阻塞型IO机制,所有的操作都是异步的。在实际编写代码的时候会出现一个问题,那就是代码的执行顺序与预期不同。这篇文章总结Promise的使用方法,以及如何使用Promise来编写并发的代码。

    2018/01/16 探索

  7. 用Python实现区块链

    近期比特币单价突破一万美元,我自14年开始认识比特币到现在短短不到4年,比特币单价翻了几十倍,出乎意料。抛离金融经济的因素,下面尝试使用Python语言实现一种自定义的区块链。

    2017/12/12 程序

  8. 不谦逊

    很多时候,两人相谈甚欢,并不是因为交流让彼此受益,只是因为,彼此都从对方那里,得到了对自己意见的赞许和认同。讲很多大道理,并不是为了帮助对方,只是为了让对方觉得自己聪明,觉得自己有价值和意义,这就是不谦逊。

    2017/12/04 探索