In this coding exercise, you are required to use the stack data structure to convert integer values to their binary equivalent.
Division by 2 Method
The slides below show how to use the division by 2 method to compute the binary equivalent for an integer.
0
Remainder
Integer Value from the division
242 / 2 = 121
Divide the number by two. Extract the non-fractional part from the answerand record the remainder from the division.
1 of 10
Coding Time!
You can build your solution based on division by 2 method. Your solution should return the correct binary equivalent of dec_num as a string from the convert_int_to_bin(dec_num) in order to pass the tests.
Make sure that you use stack while solving this challenge. The stack.py has been imported to the code. You can make use of the implementation while coding your solution. Remove the pass statement if you start implementing your solution.
Good luck!