IE

- 00:02
- Some Sorting Algorithms
- 00:02
- By: Shawn Wadhawan (883653)
- 00:09
- What a sorting algorithm is?
- 00:12
- A sorting algorithm is a computational procedure that takes as input a list of elements and outputs a permutation (rearrangement) of the input list that is sorted in some order - ascending, descending, or other logical order. In simple terms, a sorting algorithm puts things in order. They are essential in a wide range of computing tasks, from rendering data in a readable format to optimizing complex search algorithms.
- 00:33
- So what are the types of sorting algorithms?
- 00:34
- There are many types of sorting algorithm's in Python, but today, we're going to be talking about:
- 00:37
- Quick Sort
- 00:40
- Selection Sort
- 00:42
- Merge Sort
- 00:44
- 00:44
- What's selection Sort?
- 00:44
- Well, the big idea behind selection sort is actually pretty simple. The algorithm repeatedly identifies the smallest (or largest, depending on sorting order) element from the unsorted section of the list, and then swaps it with the first element of the unsorted part. This process continues, each time moving the boundary of the sorted and unsorted sections one element forward until the entire list is sorted.
- 01:08
- But first, let's figure out what Big-O is?
- 01:08
- Now, let's talk about the Big_O
- 01:13
- The Big-O notation is used in computer science to describe the performance or complexity of an algorithm. Specifically, it characterizes the worst-case scenario of an algorithm in terms of the time or space required as the input size increases. Big-O doesn't provide the exact number of operations, rather, it gives us the trend or the rate at which the number of operations grows.
- 01:23
- Consider the function f(n) = n². This function would be described as O(n²) in Big-O notation. That means as the input size n increases, the time or space required by the function increases quadratically.