Save this video free

CS 238 Week 14 Lecture

James Andro-Vasko · 15:06 · Watch on YouTube

Part of University of Nevada, Las Vegas CS 238. See all 12 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

James Andro-Vasko demonstrates selection sort by animating a randomly generated 15-element Python list, showing how the algorithm repeatedly finds the smallest unsorted value and moves it into the sorted prefix. He explains how Matplotlib, a 500-millisecond animation timer, frame snapshots, and generator `yield` statements coordinate the bar-chart updates, while noting that timer and generator timing can cause uneven animation.

Key takeaways

Chapters

0:00 Selection Sort Finds the Smallest Remaining Value
4:26 Selection Sort Indices and Matplotlib Animation Setup
9:07 Frame Redrawing with Generator Yield and Timer Callbacks

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

Transcript excerpt

0:01 Hello, CS 238 class. Uh, for this week, I guess our final week of lecture materials is going to be on visualizing algorithms. So, um, next week will be study week. So, I'm not going to cover any new material. And then, of course, the week after that will be our final exam week. And the entire week you'll have the the entire week to complete the final exam, which will just be um, another quiz, except it'll be a larger quiz than your regular quizzes, but same format. So, it'll cover all the topics we've covered all semester. So, you'll see similar type of quiz questions again, just, you know, more of them. So, let's go ahead and now talk about um, this week's topic of visualizing algorithms. So,

0:49 here we're going to cover a very known sorting algorithm known as selection sort. And we will be able to use some of Python's functionality to, I guess, help us visualize and see how selection sort works. So, let's go ahead and just first run this code so we can see how it works. And I'll of course explain the you know, the contents of selection sort. And then, of course, go through this code and just kind of go over really how we can use a timer in Python and kind of we can redraw frames to kind of give us this nice visualization, interact not interactive, but kind of visualization of how our program sorts an array.

1:38 Okay, let's go ahead and run this selection sort and I will do my best to kind of explain how it works as we let our program sort of visualize this for us. So, I ran it a couple of times beforehand, but let's go ahead and run this again. So, Python 3, our file is

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, James Andro-Vasko.

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.