Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

DSA in Python Course – Insertion Sort in Python – Part 21 [Hindi] | Code & Debug

51.7K views on YouTube

Welcome to Part 21 of Code & Debug’s DSA in Python Course! 🎉 In this video, we’ll learn about Insertion Sort, a simple and intuitive sorting algorithm, and implement it step-by-step in Python. Sorting techniques like Insertion Sort are crucial for mastering Data Structures and Algorithms (DSA).

Here’s what you’ll learn:
📌 What is Insertion Sort, and how does it work?
📌 Step-by-step explanation of the Insertion Sort algorithm
📌 Python implementation with practical examples

👉 Link to solve this question:
https://www.geeksforgeeks.org/problems/insertion-sort/0

👉 Refer the article below for better understanding:

Insertion Sort Algorithm | Explained in Python

👉 📄 Access the full YouTube DSA Playlist Sheet (All Questions in Order):
🔗 https://docs.google.com/spreadsheets/d/1AWE15Fy3wD2iqu2vjK_R7cCiuvSsjYQclcdZmHpF66o/edit?usp=sharing

👉 Enroll in the free DSA Python course here:
https://codeanddebug.in/course/master-dsa-with-leetcode

👉 Enroll for Self-Paced Advance DSA course here:
https://codeanddebug.in/course/zero-to-hero-python-dsa

👉 Don’t forget to subscribe and hit the 🔔 to stay updated with all our lectures.

Timestamps:
0:00 – Introduction
0:43 – About Code & Debug Courses
1:29 – What is Insertion Sort?
1:45 – Intuition behind Insertion Sort
2:30 – Understanding with Example
4:30 – Dry Run Starts
5:00 – Role of i, key, and j variables
7:00 – Shifting Elements Explained
10:12 – Code Explanation
10:30 – For Loop Logic
11:45 – Key Variable
12:30 – While Loop Condition
13:40 – Shifting & Decrementing j
14:50 – Placing Key in Correct Position
15:30 – Time Complexity – O(N²)
16:30 – Space Complexity – O(1)

#DSAPythonCourse #InsertionSortPython #PythonDSA #CodeAndDebug #PythonProgramming #LearnDSA #SortingAlgorithms