Avoiding overflow in binary partition

preview_player
Показать описание
This video explains how to perform binary partition by calculating the midpoint correctly. I have shown a very common mistake of calculating midpoint in a binary partition and also shown the method to avoid it. Generally, we use mid = (low + high) / 2 which leads to signed integer overflow in multiple scenarios. We should instead use mid = low + (high-low)/2 which avoids all cases of overflow. I have explained how this happens in the video.

======================================PLEASE DONATE=============================
==============================================================================

=======================================================================
USEFUL LINKS:
Рекомендации по теме
Комментарии
Автор

Love ur content Please bring more of such videos

avinashukla