Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Segment trees are objectively superior in all ways except implementation length


Another advantage to Fenwick Tree: while it shares asymptotic space complexity with Segment Tree, it has better constant factors, which can be useful in very restricted environments.


I used fenwick trees in a smart contract because space/time costs money.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: