> I have not studied how Perl implements its hash tables; I hope to find more time to study them in the future.

see https://st.aticpan.org/source/RURBAN/illguts-0.49/index.html#hv

the collisions for a bucket are stored in a linked list.

> Agreed. I too find Perl's arrays a delight to use. :)

Perl arrays use a doubling trick to ensure that push and unshift are near O(1) like with linked lists.

They allocate more memory than needed, and start and end are given by pointers° inside that area. In the rare cases it's exhausted, twice as much memory is dynamically allocated and the data transferred.

So its space for time and the cost for re-allocation is reduced to a constant on average.

And splice'ing should still be far more expensive than with linked lists.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

°) kind of a sliding window


In reply to Re^8: [OT:] Is this Curriculum right? by LanX
in thread [OT:] Is this Curriculum right? by karlgoethebier

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.