On Tuesday, 22 July 2025 at 07:32:00 UTC, Serg Gini wrote:
On Monday, 21 July 2025 at 16:13:44 UTC, monkyyy wrote:
On Monday, 21 July 2025 at 14:56:41 UTC, Serg Gini wrote:
But array doesn't look right..
If you want a balanced ("always sorted") structure with
"filter" (ability to make some requests for the data) - this
looks more like some Tree structure
Your thinking in classical theory and textbook read`n;
practice has no such restriction
If performance is not required - of course you can sort every
time when you appending new elements.
classical theory and textbooks were created to do that in a not
wacky way.
wacky
This is simpler then trees, by allot; its a bool of overhead and
1 piece of hidden control flow. Of all the things Ive posted,
this isnt wacky.
If you add n elements then iterate on the data in a sensible way,
big O will be the same as most trees while being better at using
real hardware, theory only gets you more promises around random
or hostile usage patterns.
Then consider the upgrade to radix sort, or grabbing some other
statistic