Lecture 17: Binary Heaps, Heapify Analysis, Sorting, Amortized Analysis [Advanced Data Structures]

Опубликовано: 01 Январь 1970
на канале: PageWizard Games, Learning & Entertainment
184
4

We conclude our main discussion of binary heaps today. In addition, I show you a neat connection between sorting and priority queues (that sorting can be seen like different implementations of priority queues), how to make a max heap, and we then look at heap sort, a O(n log n)-time sorting algorithm. Finally, I begin talking about amortized analysis, a common kind of worst-case analysis used in data structures. We'll talk more about amortized analysis next time!

Important Note: Line 1 of the pseudocode is wrong for heapify. It should be the floor of (n-2)/2. Why? The position of the last element is n-1, so computing its parent is floor(((n-1)-1)/2).

Supporters (to date of publication, by tier):
----------------------------------------------------------
Patreon Supporters (Basic Support):
Draikou
Tor Asbjørn Bekkelund
-----------------------------------------------------------
Become a supporter today! To support my work and mission to provide free or accessible Computer Science education (especially in theory), subscribe to the channel, share my videos. Please donate and contribute to support my work for more content:
PATREON:   / pagewizard  
SUBSCRIBESTAR: https://www.subscribestar.com/drpage
PAYPAL: https://paypal.me/pagewizard?locale.x...

Want the notes, and/or want to support my mission? Look no further, get the written companion to this video lectures series. Buy the book, Advanced Data Structures: An Introduction to Data Structures and Algorithms, it is available at the below links (by format, given in parentheses):
-Amazon (Paperback & Kindle): http://mybook.to/advanceddatastructures
-Patreon & Subscribestar (Personally-signed PDF copy, support my work at the General Support Level):   / pagewizard   https://www.subscribestar.com/drpage

Time Stamps:
0:00 Reminder of bottom-up heap construction (heapify)
1:20 Worst-case analysis of heapify (O(n)-time analysis)
19:38 Sorting & Priority Queues as a "Sorting Scheme"
28:50 Heap Sort, O(n log n) sorting, with constant extra space
34:08 Heap Sort example
42:55 Introduction to Amortized Analysis

#ComputerScience
#Algorithms
#DataStructures


На этой странице сайта вы можете посмотреть видео онлайн Lecture 17: Binary Heaps, Heapify Analysis, Sorting, Amortized Analysis [Advanced Data Structures] длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь PageWizard Games, Learning & Entertainment 01 Январь 1970, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 184 раз и оно понравилось 4 зрителям. Приятного просмотра!