Hacker News new | past | comments | ask | show | jobs | submit login

In Okasaki's _Purely Functional Data Structures_, he adds an accumulator variable to the binary (and RB, etc.) tree membership test as an optimization, because it turns the test from up to 2*depth time to constant depth+1 time. (It's exercise 2.2.)

I suspect what the post meant was that while accumulators certainly have their benefits, reflexively using them everywhere is probably a sign that you don't really understand them.




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

Search: