Python Programming: Lesson 54 - Stacks

Опубликовано: 09 Март 2025
на канале: youmils03
70
0

PLEASE SUBSCRIBE!!!

In the previous lesson (   • Python Programming: Lesson 53 - Binar...  ), we learned about a searching algorithm called binary search, which is a much faster why of searching for a target element within a sorted list or tuple. In this lesson, we shift gears to talk about an advanced data structure called a stack. Stacks are a last-in-first-out data structure, which means that it works like a stack of dinner plates. The elements at the top, or the first ones to be removed, are the last ones that were added to the stack. Inversely, the last elements that will be removed were the first ones that were added to the stack. We will write a class in Python which keeps track of list operations to implement a standard stack data type.

3:28 Review of No-input and Void Lambda Functions
4:40 NEW: Intro to Stacks
6:47 NEW: Implementing a Stack by Creating a Stack Class
15:49 NEW: Using a Stack by Creating an Instance of the Stack Class

An equivalent lesson regarding stacks in Java is available here:    • Java Programming: Lesson 52 - Stacks  

Ready for the final Python lesson, which is on queues? Check it out!    • Python Programming: Lesson 55 - Queues  

Thanks for watching, and PLEASE SUBSCRIBE!!!