Saurabh Singh Gautamsaurabhxalgorithms.hashnode.dev·Dec 23, 2024Segment Tree + Coordinate Compression: A love story or overkill ?Let’s begin with some context, I learned segment tree in my college but I never practiced it thoroughly and it costed me couple of questions in recent codeforces rounds. Thus, I wanted to understand the segment tree more in depth, it’s flexibility an...28 readsCoordinate Compression
Saurabh Singh Gautamsaurabhxalgorithms.hashnode.dev·Dec 16, 2024Segment Tree feat. Fractional CascadingRecently, I came across a fascinating technique known as Fractional Cascading. Context I was solving KQUERY (SPOJ problem) KQUERY Given a sequence of n numbers a1, a2, ..., an and a number of k- queries. A k-query is a triple (i, j, k) (1 ≤ i ≤ j ≤ ...33 readsFractional Cascading
Rohit Gawanderohit253.hashnode.dev·Nov 9, 2024Chapter 47 -Segment Trees: The Final Chapter of My DSA JourneyHey everyone! 🎉 I’m thrilled to share that this is the last chapter in my DSA with Java series! It’s been an incredible journey, and I’m excited to wrap it up with an important topic: Segment Trees. Segment trees are a powerful data structure, used ...software development
Anower Hossainanower77.hashnode.dev·Jul 14, 2024Segment Tree-1Segment Tree Basic Node Divide With Segment Tree Node Numbering (Segment Tree) // build (node, begin, end) build (1, 1, N) { L = 2xN, R = (2xN) + 1 // Node Number Calculate mid = (begin + end) / 2 left = (L, begin, mid) left = (R, ...150 readssegment-tree
Nitesh Kushwahaniteshim111.hashnode.dev·Mar 3, 2024Secret Data Structures of C++: PBDS LibraryThe PBDS (Policy-Based Data Structures) library, also known as the GNU Policy-Based Data Structures (PBDS) library, is an extension to the C++ Standard Template Library (STL) provided by GNU. It offers additional data structures that are not availabl...3 likes·160 readsordered_set
Gary Vladimir Núñez Lópezblog.garybricks.com·Sep 19, 2022Segment Tree Introduction In C++Introduction Welcome Back! In this post, we will take a beginner's dive into segment trees in c++, we will look at what are they. what are they for? and we will solve some basic competitive programming problems together. Before we begin, I highly sug...5 likes·714 readsdata structures
Mayank Rajalice-bob.hashnode.dev·Sep 7, 2022The lazy algorithm vs BITThis article was first published in the author's personal blog: https://www.alice-bob.tech/the-root-n-trick/ Back in my days of competitive coding - I realized that there are two kinds of competitive coders - one who know binary indexed trees (BIT) ...algorithms