Skip to content

Instantly share code, notes, and snippets.

View pandeydivesh15's full-sized avatar
👨‍💻
Learning

Divesh Pandey pandeydivesh15

👨‍💻
Learning
View GitHub Profile
@ih2502mk
ih2502mk / list.md
Last active July 5, 2024 10:10
Quantopian Lectures Saved
@Se7soz
Se7soz / lazy_segment_tree.cpp
Last active May 9, 2024 18:35
An example for lazy segment trees.. to read full topic visit http://se7so.blogspot.com
/**
* In this code we have a very large array called arr, and very large set of operations
* Operation #1: Increment the elements within range [i, j] with value val
* Operation #2: Get max element within range [i, j]
* Build tree: build_tree(1, 0, N-1)
* Update tree: update_tree(1, 0, N-1, i, j, value)
* Query tree: query_tree(1, 0, N-1, i, j)
*/
#include<iostream>