Should queues track size?
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 17
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
It's possible to calculate the size in amortized `O(log n)` time. Once #24 is finished, that will improve to worst-case `O(log n)` time (except in the presence of pathological nesting of `mapMonotonic` calls). Is it really worth tracking the size to get that to `O(1)`? It's not terribly expensive, but it's one more word of allocation on `insert`.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review this issue and the proposed work in #24 first. Compare the cost of tracking queue size during insert with the current amortized O(log n) size calculation, including the stated mapMonotonic nesting caveat. Done means reaching and documenting a clear decision about whether constant-time size tracking should be added.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- data, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100