Write a C function to test whether a number is a power of 2. Try to do it without using any loops.
3 responses...
Write a C function to test whether a number is a power of 2. Try to do it without using any loops.
Given a farclip distance and viewing frustum width, how can you find the angle of the field-of-view?
How can you determine if a ray intersects a sphere? The more efficient your solution, the better.
Come up with an algorithm to shuffle a deck of cards. Discuss how uniform a distribution your solution would achieve, and how you could potentially improve upon it.
Write a recursive factorial function. Then write an iterative (non-recursive) version.