www.flickr.com

Latestest

This can usually be found on Twitter.

Saturday, May 08, 2004

 
Programming
(From Slashdot) With that, here's a crash course in CS: 1. Loops are most of (time, operations) the program. Try not to use them. 2. To avoid loops, structure your data. Giving structure means assumptions, and assumptions means you can skip irrelevant sections of data. 3. Determine your dataset, minimize worst-case occurences. Find out what order of data or instructions will make your n*log2(n) algorithm become n^2. Then find away around it. 4. and optimize for average case. That is, if you never sort more than 6 numbers at a time, an n^2 will beat a n*log_2 (n) algorithm. 5. If your data structure introduces overhead (most will) find yuor most common or costly operation. Optimize your datastructure for that (searching, sorting, etc) If you do a combination determine the ratio and optimize for that. The cost of overhead is usually small compared to the reason why your using a datastructure to speed up your common operation. 6. The most obvious and easiest to code algorithm is the slowest. (Bubble sort vs. Radix or quick-sort) 7. Mastery of the above is the difference between a $50k programmer and a $90K programmer. To learn more, take a datastructures class at your local university. Please review Calculus II before doing that though. (Click here for the actual post)

This post was posted by Unknown at 5:22 am

Comments:

Post a Comment

<< Home