Back to Browse

Max in an Interval | Range Query | Point Update | Segment Tree

6.8K views
Premiered Aug 4, 2021
23:11

Please consume this content on nados.pepcoding.com for a richer experience. It is necessary to solve the questions while watching videos, nados.pepcoding.com enables that. NADOS also enables doubt support, career opportunities and contests besides free of charge content for learning. Topic: Max In A Interval - Range Query Point Update You are given an array(of integers) of length n. You are required to answer q queries. Queries can be of two types 0. 0 pos val : In this you have to update arr[pos] to val. 1. 1 l r: In this query u have to find the max among all elements in this interval. Can u do it in O(log(n)) or better Time Complexity. Used #DataStructure: #SegmentTree #Array #TimeComplexity: O(log(n)) #SpaceComplexity: 4*n -------------------------------------------------------------- Linked Questions: 1. Max In A Interval - Range Query Point Update : https://www.pepcoding.com/resources/data-structures-and-algorithms-in-java-interview-prep/segment-tree/max-in-a-interval-range-query-point-update-official/ojquestion -------------------------------------------------------------- Smimilar Questions: 1. Max In An Interval - Range Query : https://www.pepcoding.com/resources/data-structures-and-algorithms-in-java-interview-prep/segment-tree/max-in-an-interval-range-query-official/ojquestion --------------------------------------------------------------- For detailed information and other exercises, VISIT: www.pepcoding.com Have a look at our result: https://www.pepcoding.com/placements​ Follow us on our FB page: https://www.facebook.com/pepcoding​ Follow us on Instagram: https://www.instagram.com/pepcoding​ Follow us on LinkedIn: https://www.linkedin.com/company/pepcoding-education ---------------------------------------------------------------- #MaxInAnInterval #SegmentTree #RangeQuery #RangeQuery #PointUpdate #RangeQueryPointUpdate For a better experience and more exercises, VISIT: https://www.pepcoding.com/resources/ Have a look at our result: https://www.pepcoding.com/placements Follow us on our Youtube page: https://www.youtube.com/c/Pepcoding/featured Follow us on our FB page: https://www.facebook.com/pepcoding Follow us on Instagram: https://www.instagram.com/pepcoding Follow us on LinkedIn: https://www.linkedin.com/company/pepcoding-education Follow us on Pinterest: https://in.pinterest.com/Pepcoding/_created/ Follow us on Twitter: https://twitter.com/home . . . Happy Programming !!! Pep it up 😍🤩 . . . #pepcoding #code #coder #codinglife #programming #coding #java #freeresources #datastrucutres #pepcode #competitive #competitiveprogramming #softwareengineer #engineering #engineer

Download

0 formats

No download links available.

Max in an Interval | Range Query | Point Update | Segment Tree | NatokHD