Save this video free

Priority Queues and Disjoint Union

Kent Quanrud · 1:14:31 · Watch on YouTube

Part of Purdue University Fundamental Algorithms (Fall 2026). See all 21 lectures and search them

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

The lecture develops a simplified Fibonacci-heap-style priority queue using tournament trees, showing how deferred cleanup and a potential function yield amortized O(1) insertion and decrease-key, plus O(log n) delete-min. It then analyzes disjoint-set union with union by rank and path compression, first deriving an O(log* n) amortized bound through rank thresholds and explaining how more intricate Ackermann-based thresholds give the inverse-Ackermann bound.

Key takeaways

Chapters

0:00 Why Dijkstra and Minimum Spanning Trees Need Priority Queues
6:00 Tournament Trees: Leaves Store Values, Internal Nodes Store Minima
12:00 Distinct Tree Heights and the Unary-Node Height Problem
18:00 A Potential Function Pays for Heap Cleanup
24:00 Constant-Amortized Insert and Decrease-Key
34:00 Delete-Min Scans Roots and Cuts One Tree
41:00 Disjoint Sets Support Kruskal's Component Checks
47:00 Union by Rank Attaches the Shorter-Rank Root
51:00 Union by Rank Bounds Tree Height by Log n
56:00 Path Compression Flattens Find Paths
1:00:00 Rank Thresholds Separate Big and Small Parent Hops
1:04:00 Exponential Rank Growth Yields an O(log* n) Bound
1:08:00 Ackermann Thresholds Give the Inverse-Ackermann Bound

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:06 Okay. So, uh Okay. So, today we're going to do uh two data structures. Actually, we might only do the first one based on how it went last year. Um but they're both data structures that you've seen used in algorithms uh so far. And they're going to be like uh sort of like hardcore applications that amortize analysis. I don't think it's that important to know all the details, but it might be nice to see like one of these worked out and kind of going through the intricacies so you get some sense of of what these people in this area do. So, right, and this is sort of our our closing part of the of the class. We're kind of alternating between uh amortize analysis and randomized analysis. Both give you uh slightly different senses of the word like average, right? So amortize is kind of doing these running

0:53 times where you know you do a bunch of different operations and some might actually take longer than another. You know one one might do something like garbage collection or something and kind of pause everything. Um uh but in hindsight on average they're all going to look pretty good, right? It's as if it were fast the whole time. Uh and in in randomized algorithm the average is coming from the algorithm actually deliberately flipping coins and making random choices like in quicksort or something. Okay. And then we look at the expected running time over all kind of possible coin flips. Okay. Now, one thing that that neither of these uh notions of average give up is worst case analysis, right? So, we're always still saying no matter the input, you get such and such and such on average. Okay? So, a completely different field looks at

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

In this course

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Kent Quanrud.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.