MIT Algorithms (1)

1)  f(n) = O(g(n))
    It means there are consts C > 0, n > 0 such that 0 <= f(n) <= c * g(n) for sufficiently large n.
    f(n) = Ω(g(n))
    It means there are consts C > 0, n > 0 such that 0 <= c * g(n) <= f(n) for sufficiently large n.
    
    O notation, less than or equal to.
    Ω notation, greater than or equal to.
    Θ notation, less than or equal to AND greate than or equal to.
2)  Macro convention
    A set in a formula represnts on anonymous function in that set.
    
3)  big O is upper bounds
O notation, less than or equal to.
Continue reading MIT Algorithms (1)

自动生成简单Java程序的UML图

最近Java实验课老是要求画出UML图,各种麻烦。。。

于是就写了这样一个东西,传入一个(或多个)Java源代码的path,然后得到该源代码的UML图,不过只能是一些写得比较简单的Java源代码,在复杂的情况下可能会出现错误的解析。得到的文件是一个(或多个)与Java源代码文件同名的HTML文档。

本来想用php的GD库,不过Mac下的GD库编译安装太麻烦了,于是就放弃了。果然还是直接在网页上截图吧,至少比自己去画方便一些了w

Continue reading 自动生成简单Java程序的UML图