Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. given n, print all the combinations of 0 and 1 of length n
  2.  
  3. example:
  4. input: n = 2
  5. output:
  6. 00
  7. 01
  8. 10
  9. 11
  10.  
  11. input: n = 3
  12. output:
  13. 000
  14. 001
  15. 010
  16. 011
  17. 100
  18. 101
  19. 110
  20. 111
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement