http://www.imooc.com/learn/317
模块和包
包: 文件夹 (可以有多级), 且包含__init__.py文件(每层都要有)
模块: py文件
代码分开放在多个py文件(模块名=文件名). 同 …
http://www.imooc.com/learn/317
包: 文件夹 (可以有多级), 且包含__init__.py文件(每层都要有)
模块: py文件
代码分开放在多个py文件(模块名=文件名). 同 …
Goal: classify problems according to computational requirements.
bad new: for huge number of pbs we don't know...
shifing gears:
suppose we could (not) solve pb X efficiently …
http://www.imooc.com/learn/317
函数式编程: 更抽象, 更脱离指令(计算机), 更贴近计算(数学).
总结了一下C++ STL里面用的比较频繁的一些代码片段. (地址: https://github.com/X-Wei/cpp-demo-snippets/tree/master/STL)
cpp文档: http://en.cppreference.com/w/cpp
常用的library主要有:
<algorithm>, <vector>, <queue>, <set>, <map>, <cmath>
另外一个常见的cpp文件开头版本是:
#include <iostream>
#include <vector>
#include <algorithm>
using namespace …pb: reduce the size of a file, to save space/time for storing/transmitting.
applications: generic file compression(gzip), multimedia (mp3), communication(skype).
From binary data B, ⇒ generate a compressed representation C(B).

lossless compression: get exactly B from C(B)
compression ratio: |C(B …
三月初结束了在X的最后几门考试, X的课从来都不简单, 但我真的很享受, 尤其是那些数学课.
(不过刚考完就sb了: 陪伴我两年的杯子丢了...)
Polytechnique, 从憧憬 …
pb: pattern matching.
Is a notation to specify a set of strings.
basic operations:

additional operations (added for convinence):

ex. [A-C]+ is equivalent to (A|B|C)(A|B|C)*.
吐槽名句:
今天简单介绍一下优先队列(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).
快速排序的算法可以用三 …