Sep 19, 2025 · 2 min read · In the recent few days the daily leetcode questions were from the topic of Priority Queue where we were needed to arrange elements in a particular order it may time, rating or let's day price why not With decent practice of Priority Queue, I tried to...
Join discussionSep 6, 2025 · 4 min read · If you’re a developer, you've probably worked with message queues. Systems like Kafka and RabbitMQ are the titans of the industry, and for good reason. They're amazing at what they do: taking a massive stream of messages and making sure they get deli...
Join discussion
Aug 8, 2025 · 11 min read · Before diving into PriorityQueue, it’s important to first understand the concept of heaps in Java. Heap A heap is a special kind of tree structure used to store data. It follows a simple rule: in a max-heap, parents are always bigger than or equal to...
Join discussion
Jul 24, 2025 · 4 min read · Series: Java Collections Framework | Part 2 – Queue Hello Devs! 👋Welcome to the second blog in my Java Collections Framework series. After exploring the Set interface, we’re now diving into the Queue interface, which is another essential part of the...
Join discussion
Jul 18, 2025 · 6 min read · Problem Statement LeetCode 2163: Minimum Difference in Sums After Removal of Elements Difficulty: Hard Topics: Array, Dynamic Programming, Heap (Priority Queue) Date: 18 July 2025 You are given a 0-indexed integer array nums consisting of 3 * n el...
Join discussion
May 18, 2025 · 4 min read · 🧭 Introduction Heaps are specialized binary trees that maintain a specific order, enabling fast access to the highest (or lowest) priority element. Heaps play a critical role in solving problems involving priority queues, scheduling, and streaming d...
Join discussion
Mar 24, 2025 · 5 min read · There are many cases where maintaining a priority-based queue is essential. For instance, it may be required to rebalance a financial portfolio by reallocating assets with the highest deviation first. Another example is ranking updates when processin...
Join discussionMar 20, 2025 · 8 min read · “We use operating systems every day—on our laptops, phones, and even embedded devices. But with limited CPU and memory, how does a computer efficiently manage multiple tasks at once? The OS must decide which process runs first.” Imagine you’re gaming...
Join discussion
Feb 26, 2025 · 2 min read · Thought for a second 優先佇列(Priority Queue)就像是一條排隊,但這條隊伍不是「先到先服務」,而是依照每個人(或每件事情)的「重要性」來決定誰先誰後。 用生活中的例子來理解 想像一下你和朋友們排隊等候滑水道,但其中有人拿到了 VIP 票。即使他們可能比其他人晚到,只要他們有 VIP 票,就可以直接插隊到前面。這樣,隊伍裡的順序就不是按照誰先到,而是按照誰的 VIP 等級(也就是「優先權」)來決定的。 在電腦中,我們用「優先佇列」這個資料結構來處理這種狀況。每個元...
Join discussion