A link queue based on priority, using binary heap.

Implements

  • ILinkQueue

Constructors

Properties

links: ILink[] = []

Max heap with links and their priorities

urlToLink: Record<string, ILink> = {}

Data structure to track URLs in the queue and allow for constant time lookup of links in queue based on link URL

Methods

  • Changes all priorities in queue in O(n + m*log m ) time, with n is size of urlPriorities entry and m size of the queue. Will only update priorities of urls that are actually in queue.

    Parameters

    • urlPriorities: Record<string, number>

      A record with url and new priority

    Returns void