×
Home Discussions Write at Opengenus IQ
×
  • #7daysOfCode
  • C Interview questions
  • Linux 💽
  • 🔊 Data Structures
  • Graph Algorithms
  • Dynamic Programming 💑
  • Greedy Algo 📔
  • Algo Book 🧠
  • String Algo 🧬
  • Join our Internship 🎓
  • Home

range minimum query

A collection of 3 posts

Algorithms

Range Minimum query using segment tree [O(log N) update + O(log N) query]

In this article, we have solved the Range Minimum Query using Segment tree which takes O(log N) time for both update and range query. This is one of the best approaches to solve this problem.

Siddharth Agarwal Siddharth Agarwal
Algorithms

Range Minimum query using square root decomposition [O(1) update + O(sqrt N) query]

In this article at OpenGenus, we have solved the Range Minimum Query problem using Square Root Decomposition which takes constant time O(1) for update and O(square root of N) time for range query.

Siddharth Agarwal Siddharth Agarwal
Algorithms

Range Minimum query using Naive algorithm [O(1) update + O(N) query]

In the naive approach for range minimum query, we can execute the update query in constant time which is efficient and the best case but the query operation takes linear time O(N) which is slow depending upon number of elements and queries.

Siddharth Agarwal Siddharth Agarwal
×

Visit our discussion forum to ask any question and join our community

View Forum
OpenGenus IQ © 2021 All rights reserved â„¢ [email: team@opengenus.org]
Top Posts LinkedIn Twitter