[Python] Fastest implementation of a Priority Queue with frequent inserts [closed]

Discussão em 'Python' iniciado por Stack, Setembro 30, 2024.

  1. Stack

    Stack Membro Participativo

    What priority queue implementation has the best run time when you insert twice as frequently as delete min.

    I was lookin at this question Which priority queue is faster in practice? but the OP cared more about get min than inserts. I did some digging too on Fibonacci heaps but found that they are only better when you have less inserts than get mins. Brodal queues also seem fast but I'm not sure if they are efficient in practice.

    Some implementations:

    • Binary
    • Skew
    • Leftist
    • Binomial
    • Skew binomial
    • 2–3 heap
    • Bottom-up skew
    • Pairing
    • Rank-pairing
    • Fibonacci
    • Strict Fibonacci
    • Brodal

    Or maybe even bucketing? What would be the fastest in practice? Thanks.

    Continue reading...

Compartilhe esta Página