You are given two 32-bit signed integers dividend and divisor.
Implement a function that divides dividend by divisor and returns the integer quotient, without using the multiplication *, division /, or modulo % operators.
The result should be truncated toward zero (i.e., rounded toward 0, not toward −∞ or +∞).
Assume:
divisor
is not zero.
You must:
2^31 - 1
(the maximum 32-bit signed integer).
divisor
from
dividend
one unit at a time).
Function signature example (language-agnostic):
Explain the algorithm you would use and then implement the function in the programming language of your choice.