Created
February 16, 2023 14:24
-
-
Save ChicagoDev/2b35d218f4d1615d112c5e077abbfc56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void function(int N) { | |
Stack<Integer> stack = new Stack<Integer>(); | |
while (N > 0) { | |
stack.push(N % 2); | |
N = N / 2; | |
} | |
for (int b: stack) {StdOut.print(b);} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment