Tag: heap_sort
Network Delay Time - Dijkstra's Algorithm
Date: 3/8/2024Tags:algorithmsleetcodeheap_sortgraphThe journal entry discusses the application of Dijkstra's Algorithm to find the shortest path to all nodes in a graph, explaining a step-by-step process followed by an implementation code that uses a min heap to calculate the network delay time between nodes effectively.
Task Scheduler
Date: 2/28/2024Tags:algorithmsleetcodeheap_sorthash_tableThe journal entry discusses the Task Scheduler problem, which involves scheduling tasks with cooling intervals efficiently by prioritizing tasks based on frequency using a max heap, with provided code implementing the scheduling algorithm.
Top K Frequent Elements - Binary Heap
Date: 2/17/2024Tags:algorithmsleetcodeheap_sortThe journal entry covers the implementation of a Top K Frequent Elements solution using a MaxHeap, detailing the algorithm's construction of a hash table to store number frequencies, subsequent utilization of the MaxHeap for efficient element retrieval, comparison with a MinHeap approach, and plans to explore the QuickSelect algorithm for potential performance enhancements.
Smallest Number in Infinite Set - 3rd attempt
Date: 2/7/2024Tags:algorithmsleetcodeheap_sortThe journal entry explores the implementation of a while loop in a code that checks for the smallest child in a heap using short-circuit evaluation, optimizing comparisons and mirroring real-life decision-making processes. The accompanying material provides a code that includes a class for maintaining a min heap and a HashSet to support the implementation.
Smallest Number in Infinitive Set - 2nd attempt
Date: 2/6/2024Tags:algorithmsleetcodeheap_sortThe journal entry discusses how to handle corner cases in the `pop` function of the `MinPQ` class, addressing scenarios where the heap is empty or contains only one element, while also providing code implementation for a class called `SmallestInfiniteSet` that utilizes the `MinPQ` and `HashSet` classes.