---
title: "Discussion on \"Binary Search\" | Hashnode"
description: "Discussion on \"Binary Search\". Binary search (BS) is one of the most important concepts in CP algorithms in general. You will use binary search everywhere.\nWe will see what is BS, the different implementations of BS, what are the things to remember while implementing BS, what is s..."
url: "https://hashnode.com/posts/binary-search/63c7f48216cfbf7c0f2b412f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Binary Search](https://teckbakers.hashnode.dev/binary-search?utm_source=hashnode&utm_medium=feed)

Binary search (BS) is one of the most important concepts in CP algorithms in general. You will use binary search everywhere. We will see what is BS, the different implementations of BS, what are the things to remember while implementing BS, what is s...

Jan 18, 2023 · 11 min read · teckbakers.hashnode.dev  
Updated Feb 24, 2024  
Read the article

-   [#competitive-programming](https://hashnode.com/tag/competitive-programming)
-   [#binary-search-algorithm](https://hashnode.com/tag/binary-search-algorithm)
-   [#algorithms](https://hashnode.com/tag/algorithms)
-   [#cpp](https://hashnode.com/tag/cpp)
-   [#iratherfear](https://hashnode.com/tag/iratherfear)

## Written by

[Aman Nadaf](https://hashnode.com/@iRatherFear)

@iRatherFear

  
[View profile](https://hashnode.com/@iRatherFear)

Competitve Programmer

I am a competitive programmer, here to write blogs &amp; share knowledge.

## Responses 1

Markdown supported · ⌘↵ to post

[Robin Mason](https://hashnode.com/@robmon)

[Feb 9, 2023](https://hashnode.com/posts/binary-search/63c7f48216cfbf7c0f2b412f/comment/63e4b915d0024cf4f3e75cd2)

To your attention writer, the line "This causes an overflow error. In C++ any value which is greater than 2147483647 (2^33 - 1) gets started back with (-2^33)" looks completely wrong and misleading. The idea you are trying to convey is appreciable but the information you have provided is not to the mark. It is -2^31 and not -2^33. This value is contradictory in itself as signed integer in C++ cannot hold values beyond -2^31. Overflow takes values from extreme positive to lowest possible value depending on whether the integer is signed or not. I request you to avoid such mistakes for yet-to-come corpus.

[Aman Nadaf](https://hashnode.com/@iRatherFear)

[Feb 9, 2023](https://hashnode.com/posts/binary-search/63c7f48216cfbf7c0f2b412f/comment/63e4b915d0024cf4f3e75cd2#reply-63e4c25dd0024cf4f3e75e54)

Thank you for noticing i have updated the post.
