can we use stack(it works) to reverse the bits, instead of power logic ?
Can we use stack(it works) to reverse the bits, instead of power logic?
Is the question like this that you are given a set of character(might be a,b,c or any number) and you have to reverse that?
if we are convedting any no to binary in its representaion then it comes as its reverse, so im saying that we can also use stack bcz it works, instead of power logic, bcz again n again multiplying power it becomes very large value which cause fault in ans
Can you tell me the question so that i can check whatever logic you are applying is right or not, as it’s video attached so it will take time if i watch it and understand the question. So if you can tell me the question, i can solve your query within minutes.
topic bm : decimal to banary using bit wise.
Hey @Mr_Sidd i watched the video, yes you can use stack too, do what store all the binary bit in a stack one by one then pop it out after storing all digits and you will reverse it. Though what bhaiya did is when there will be a constraint that you can’t use O(N) space then you have to apply the same logic as bhaiya did.
yes thats what I am saying, I got it.
Mark your doubt as resolved if this solves your query
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.