1) Divide and conquer
1. Divide
divide the problem (instance) into one or more subproblems
2. Conquer
conquer each problem recursively
3. Combine
2) Merge sort
1. divide into 2 halves
2. recursively sort each subarray
3. to combine the solution
4. merge
Continue reading MIT Algorithms (2)
Tag Archives: English
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)
iOSOpenDev command line tool build error
Those days, I upgraded my Xcode to XCode6. Then when I compiling a command line tool, it gave me 1 error that
target specifies product type 'com.apple.product-type.tool', but there's no such product type for the 'iphoneos' platform
The application hierarchy changes in iOS 8
As all we know, iOS 8 - iOS 8.1 are able to be jailbroken by pangu jailbreak. After jailbroken my device, I found it is much different from previous iOS version.
Install Cydia on iOS 8 - iOS 8.1 manually
To install Cydia on iOS8-8.1 manually.
1. Install OpenSSH in pangu application.
2. Download those two debs on your computer.
http://apt.saurik.com/debs/cydia-lproj_1.1.12_iphoneos-arm.deb
http://apt.saurik.com/debs/cydia_1.1.13_iphoneos-arm.deb
Do NOT use "void main()" in C/C++
When I had the class 「Fundamental of Computer Science」 tonight, my teacher present a slide that writes void main(). I pointed out the mistake that main function's return type should be int in C/C++.
The father of C++ program language, Bjarne Stroustrup, once posted this on his personal website in column C++ Style and Technique FAQ.
a brainfuck problem
Yesterday evening, 0xSuu sent me a problem but which requires to write in brainfuck language. The complete problem is here.
Continue reading a brainfuck problemUbuntu force change passwd
Objective-C Runtime - Ivar
This post shows how to read and write an instance var in another class.
Remove PIE
Recently, I'm doing some development which need to remove PIE on a particular application. After my searching on Google, I found a tool named MyRemovePIE, and it's really useful. So I wrote a same function tool just for him. And yes, it's based on MyRemovePIE's codes.
Continue reading Remove PIE