Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Learn Big O ITT

Name: Anonymous 2015-04-29 14:44

* O(2^n) very very slow
* O(n^2) pretty slow...
* O(n log n) nice and efficient
* O(n) very fast
* O(1) instant

Name: Anonymous 2015-04-29 19:58

Leart about performance here:

Next, on my local programming IRC channel, I shared a little trick I’d seen on Twitter for replacing a div with a shift: (i+1)%3 == (1<<i)&3 for i in [0, 2]. One person strenuously objected to the idea of using this trick. Paraphrasing, their argument went something like "the meaning of the code is not clear, so tricks like that should be left to the compiler, but it doesn’t work for all values of i, so a compiler would never actually substitute the left for the right. Just don’t bother."

http://chadaustin.me/2015/04/thinking-about-performance/

Truly Expert.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List