Hi! How fast algorithm can you write for finding out if an integer is a power of two?
Try google. It's great for helping with homework.
Posting code? Use code tags like this: [code]...Your code here...[/code] Click here for examples of Java Code
Check out this page http://graphics.stanford.edu/~seander/bithacks.html
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. - Brian W. Kernighan To enhance your chance's of getting an answer be sure to read http://www.codeguru.com/forum/announ...nouncementid=6 and http://www.codeguru.com/forum/showthread.php?t=366302 before posting Refresh your memory on formatting tags here http://www.codeguru.com/forum/misc.php?do=bbcode Get your free MS compiler here http://www.microsoft.com/visualstudio/eng/downloads
Forum Rules
Bookmarks