12345678class the_earth { … }; class the_meek : public the_earth { … }; From: StackOverflow answer
Monthly Archives: July 2009
Bit Operations
July 4 09
For CS351, Intro to Systems, we had to do several operations using bit operators only. These took awhile, but are pretty cool to show off. We were graded by how few operations we used to return the right values for the generated test cases, including some difficult boundary ones.
Euclidean Algorithm
July 3 09
One of my favorite algorithms is the simple, elegant Euclidean algorithm for finding the greatest common denominator of two numbers. In ML or another functional language it really is beautiful:
Recursive Fibonacci
July 3 09
Here are two recursive fibonacci functions in ML I did for CS243. Can you tell which one is more efficient?
Circle Calculator
July 3 09
For my first code post I thought it might be appropriate to put the first code from the first lab of my first computer science class at Wheaton.