TheAlgorithms / PHP

All Algorithms implemented in PHP
MIT License
2.15k stars 468 forks source link

Implemented Segment Tree Data Structure #166

Closed Ramy-Badr-Ahmed closed 1 month ago

Ramy-Badr-Ahmed commented 2 months ago

Contents:

Time Complexity

A time complexity of O(log n) for both query and update operations, where n is the size of the input array. The build operation takes O(n log n) in total.

GitHub Actions

All tests and workflows (in my forked repository) have passed:

Code style

directory_md

PHP Composer


Reference

The Algorithm Design Manual, Latest edition

Ramy-Badr-Ahmed commented 1 month ago

Thank you for the addition!

Thanks for the review and merge 🙂