---
title: "Discussion on \"Why use left+(right-left)/2 instead of (left+right)/2 in sorting algorithms?\" | Hashnode"
description: "Discussion on \"Why use left+(right-left)/2 instead of (left+right)/2 in sorting algorithms?\". In most sorting algorithms that use the divide and conquer approach, you'd need to find the middle index between two indices. If l is the left index and..."
url: "https://hashnode.com/posts/why-use-lr-l2-instead-of-lr2-in-sorting-algorithms/613c49cc22b7a41dfe5fb72b"
---

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

Discussion

# [Why use left+(right-left)/2 instead of (left+right)/2 in sorting algorithms?](https://satyamsundaram.hashnode.dev/why-use-lr-l2-instead-of-lr2-in-sorting-algorithms?utm_source=hashnode&utm_medium=feed)

In most sorting algorithms that use the divide and conquer approach, you'd need to find the middle index between two indices. If l is the left index and...

Sep 11, 2021 · 2 min read · satyamsundaram.hashnode.dev  
Updated Oct 23, 2024  
Read the article

-   [#sorting](https://hashnode.com/tag/sorting)
-   [#data-structures](https://hashnode.com/tag/data-structures)
-   [#algorithms](https://hashnode.com/tag/algorithms)
-   [#computer-science](https://hashnode.com/tag/computer-science)

## Written by

[Satyam Sundaram](https://hashnode.com/@satyamsundaram)

@satyamsundaram · India

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

Site Reliability Engineer @ Media.net

I am a CS graduate from IIEST Shibpur (2023). I love to go deep into computers and the Internet and find out how both of them work from first principles. I want to be capable of understanding both of them with full depth to make them more secure and truly understand and harness their capabilities. I also love to build scalable systems in the backend and test them to their limits. I aim to build products people want, at scale.

## Responses 1

Markdown supported · ⌘↵ to post

[Aditya Singh](https://hashnode.com/@Lumiere)

[Sep 11, 2021](https://hashnode.com/posts/why-use-lr-l2-instead-of-lr2-in-sorting-algorithms/613c49cc22b7a41dfe5fb72b/comment/613c521d1821961e2551df9e)

Clear and concise explanation of a nuanced topic that is often overlooked, love to see it!

[Satyam Sundaram](https://hashnode.com/@satyamsundaram)

[Sep 11, 2021](https://hashnode.com/posts/why-use-lr-l2-instead-of-lr2-in-sorting-algorithms/613c49cc22b7a41dfe5fb72b/comment/613c521d1821961e2551df9e#reply-613cca2322b7a41dfe5fc91f)

Thank you for reading! 😁️ I hope to bring more meaningful explanations of all things tech. I am a wannabe polymath too. Cheers. 🎉️
