|
The partition algorithm breaks up the list into two kind-of-sorted portions. In this video, we show how to use this fact with divide-and-conquer to implement a new sorting algorithm: quicksort. For…
|
|
In this video we introduce insertion sort, which is one of the simplest sorting algorithms to understand. If you have ever sorted cards in your hand it is likely that you have used this sorting…
|
|
This video introduces an advanced topic that is completely optional and is not relevant to the final assignment. If you Google Python and coroutines, you will get something very different than what…
|
|
Our primary application of coroutines in the final assignment is timed animations. In this video we talk about what these are and how to design them with the GameApp class.
|
|
Game applications (and graphical applications in general) can get pretty complicated. In this video we talk about how to break up your code to make it more readable and more manageable. In some…
|
|
Even though you only need to implement three methods in GameApp subclass, this methods will eventually get very long. In this video we introduce the concept of application state, and talk about how…
|
|
When we were recording the video on custom error types, it ran quite long. So we decided to break it up into a second video. In this video we look at a slightly more complicated error type. We also…
|
|
Operator overloading allows us to redefine the meaning of + or * on objects of our class. But sometimes we want to mix together types like a fraction and integer. In this video we show that it is…
|
|
In this video we introduce the primary tool for abstraction in Python. Operator overloading allows us to define additional meanings for any built-in symbol such as + or *. Because Python uses the…
|
|
In this video we show that thte primary purpose of the super function is in the initializer method of the subclass. That is because we cannot guarantee that all of the attributes for the parent class…
|
|
Sometimes you do not want to completely override a method. You just want to override part of it, or add a few extra features at the end. In this video, we introduce the super function which allows us…
|
|
Subclasses inherit all of the methods of their parent. But suppose you do not want to use the inherited version of a method, but want to define a new one instead? In this video we talk about the…
|
|
When we first introduced objects, we talked about the concept of object representation. But how does Python know how to use this representation. In this video, we see that this is the result of…
|
|
Divide-and-conquer is not the only example of recursion. It just happens to be one of the most interesting. But in this video we show that even some of the simplest of recursive definitions become…
|
|
In this session we review how we read error messages in Python. We also show how to both create errors and how to recover from them.Once again, we will spend a significant amount of this class on…
|
|
Sometimes we absolutely need to enforce all of our preconditions, and we cannot live with the compromises of the previous video. In this video we show how to use top-down design to give us more…
|