Ask Question
22 November, 14:25

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.

+5
Answers (1)
  1. 22 November, 15:45
    0
    Int count (int num)

    if num==0 return 0;

    return (n&1) + count (n/2)
Know the Answer?
Not Sure About the Answer?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers