今天简单介绍一下优先队列(priority queue, 以下简称PQ)这个数据结构的实现.
PQ又叫"堆"(heap), 但是可能优先队列这个名字更容易记忆它的 …
今天简单介绍一下优先队列(priority queue, 以下简称PQ)这个数据结构的实现.
PQ又叫"堆"(heap), 但是可能优先队列这个名字更容易记忆它的 …
"most ingenious algorithm we've seen so far"
pb. having two strings, pattern and text, len(pattern)=M << len(text)=N, try to find pattern in text.
ex. indexOf method of String in java.
function signature:
public static int search(String pat …
今天总结一下非常有用的快速排序(qsort)算法, 以及由此衍生的一些其他相关算法(Knuth shuffle, quick select, 3-way partition).
快速排序的算法可以用三 …
More efficient version of symbol-table where the keys are strings.
Two implementations of symbol tables that we've seen:

when keys are strings:
(L=string length, N=number of strings, R=radix)
for string keys ⇒ do better by avoiding examing the entire key.
goal: faster than hashtable, more …
This week: string sort.
8-bit integer, 256 characters, 7-bit ASCII code
16-bit Unicode
String: immutable sequence of characters
operations: lengthe, ith char, substring, concatenate
implementation: using a char[], maintain a length and an offset …
今天介绍一个论文写作的神器: TeXmacs !
一说到"论文写作神器"一般大家首先想到的就是LaTeX, 确实LaTeX写出来的数学公式和文章的排版非常漂亮. 但是作为一个几年来 …
e has weight("capacity") c[e]>=0, a source vertex s, a target vertex t. (A,B) is a partition of vertices into 2 disjoint sets A and B, with s in set A and …context: directe, weighted graphs.
in terms of vertices:
constraints on edge weights:
cycles:
Given: undirected connecte graph G with positive edge weights.
def. Spanning tree T
is a subgraph of G, that is both tree (connected, acyclic) and spanning(all vertices are included).
⇒ Goal: find a spanning tree with minimum weight sum.
assumptions for simplification:
Has profound differences wrt undirected graphs.
def: digraph
edges: have directions
vertex: distinguish indeg and outdeg
digraph pbs: