Skip to content

Implement heapify in HeapPriorityQueue.addAll #732

Closed
@aamirki

Description

@aamirki

Current HeapPriorityQueue calls add for each element in the given Iterable yielding a time complexity of $O(n * logn)$, but if the heapify algorithm is used instead the time complexity can be reduced to $O(n)$. This has been done in other languages such as Go for example: https://cs.opensource.google/go/go/+/refs/tags/go1.23.4:src/container/heap/heap.go;l=41

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions