29 Divide Two Integers
1. Question
Divide two integers without using multiplication, division and mod operator.
If it is overflow, return MAX_INT.
2. Implementation
(1) 倍增法
3. Time & Space Complexity
倍增法:时间复杂度O(log(divisor)), 空间复杂度O(1)
Last updated