AlgoGenesis / C

AlgoGenesis is a centralized open-source platform dedicated to providing optimized and well-documented algorithm implementations in C. Perfect for both beginners and advanced users, this repository serves as a comprehensive learning resource for solving algorithmic challenges.
MIT License
88 stars 306 forks source link

Binary Indexed Tree (Segment Tree & Fenwick Tree) #288

Closed MahraibFatima closed 1 month ago

MahraibFatima commented 1 month ago

Description:

Checklist:

Additional Information:

Segment Tree:

A segment tree is a binary tree used for answering range queries and updates efficiently in O(log n) time. It divides the array into segments and processes range operations like sum, min, or max over intervals. With modifications like lazy propagation, it can handle range updates without recalculating the entire tree.

Fenwick Tree (Binary Indexed Tree):

A Fenwick Tree is a compact data structure used for cumulative frequency tables and range queries. It efficiently supports prefix sum queries and point updates in O(log n) time, using an internal binary representation to propagate changes across nodes. It's simpler and often preferred for smaller use cases like frequency queries.

github-actions[bot] commented 1 month ago

👋 Thank you for raising an issue! We appreciate your effort in helping us improve. Our team will review it shortly. Stay tuned!

pankaj-bind commented 1 month ago

@MahraibFatima assigned