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 – Alien Dictionary | Topological Sort in Graph | GFG | Part 141 [Hindi]

1.7K views on YouTube

πŸ‘½ Welcome to Part 141 of Code & Debug’s DSA in Python Course!
In this session, we solve the popular Alien Dictionary problem from GFG using Topological Sorting in Directed Graphs.

This is a classic application of Kahn’s Algorithm / DFS-based Topo Sort, where we infer the character order of an alien language based on a sorted dictionary.

πŸ” In this video, you will learn:
βœ… How to model problems as Directed Acyclic Graphs (DAG)
βœ… Building adjacency list based on character precedence
βœ… Performing Topological Sort (Kahn’s Algorithm / DFS approach)
βœ… Dry run, edge cases & input modeling
βœ… Complete time and space complexity analysis

πŸ“„ GFG Problem Link:
https://www.geeksforgeeks.org/problems/alien-dictionary/1

πŸ‘‰ πŸ“„ 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 Like πŸ‘, Share πŸ”, Comment πŸ’¬, and Subscribe πŸ”” for more amazing content!

#AlienDictionary #TopologicalSort #KahnsAlgorithm #GraphProblems #GFG #PythonDSA #CodeAndDebug #Part141 #GraphCharacterOrdering #InterviewPrep #DirectedGraph #TopoSort