Ask Question
19 May, 05:06

Write a recursive method in pseudo code that returns the number of 1's in the binary representation of n. use the fact that this equal to the number of 1's in the representation of n/2, plus 1, if n is odd.

+2
Answers (1)
  1. 19 May, 07:52
    0
    Int count (int num)

    if num==0 return 0;

    return (n&1) + count (n/2)
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a recursive method in pseudo code that returns the number of 1's in the binary representation of n. use the fact that this equal to ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers