Count the Number of Complete Components | Multiple Approaches | Leetcode 2685 | codestorywithMIK
Whatsapp Community Link : https://www.whatsapp.com/channel/0029Va6kVSjICVfiVdsHgi1A
Disjoint Set Union - • Disjoint Set Union | DSU | Graph Conc...
Disjoint Set Union By Rank and Path Compression - • Disjoint Set Union By Rank and Path C...
Disjoint Set Union By SIZE and Path Compression - • Disjoint Set Union By SIZE and Path C...
Hi Everyone, this is the 71st video of our Playlist "Graphs : Popular Interview Problems".
Now we will be solving a good Graph practice problem - Count the Number of Complete Components | Multiple Approaches | Leetcode 2685 | codestorywithMIK
We will focus on why this is a Graph based problem and why Topological Sort is the ideal approach for this problem.
Problem Name : Count the Number of Complete Components | Multiple Approaches | Leetcode 2685 | codestorywithMIK
Company Tags : AMAZON
My solutions on Github(C++ & JAVA) - https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/Graph/Disjoint Set/Count the Number of Complete Components.cpp
Leetcode Link : https://leetcode.com/problems/count-the-number-of-complete-components
My DP Concepts Playlist : • Roadmap for DP | How to Start DP ? | ...
My Graph Concepts Playlist : • Graph Concepts & Qns - 1 : Graph will...
My Segment Tree Concepts Playlist : • Segment Tree | Introduction | Basics ...
My Recursion Concepts Playlist : • Introduction | Recursion Concepts And...
Trie Playlist - • Word Search II (Google, Amazon, Meta,...
Difference Array Technique: Concepts & Qns : • Introduction | What | How | Differenc...
My GitHub Repo for interview preparation : https://github.com/MAZHARMIK/Interview_DS_Algo
Instagram : https://www.instagram.com/codestorywithmik/
Facebook : https://www.facebook.com/people/codestorywithmik/100090524295846/
Twitter : https://twitter.com/CSwithMIK
Subscribe to my channel : / @codestorywithmik
╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝
Video Summary :
DFS Approach: This method uses Depth-First Search to traverse the graph and count the number of vertices and edges in each connected component. It then checks if the component forms a complete subgraph by verifying the number of edges.
BFS Approach: This method replaces DFS with Breadth-First Search using a queue. It explores each component level by level, tracking the number of vertices and edges. The completeness condition is checked similarly to the DFS approach.
DSU Approach: This method utilizes Disjoint Set Union (Union-Find) to group connected components efficiently. After forming components, it counts edges within each set and verifies if they satisfy the complete graph condition.
✨ Timelines✨
00:00 - Introduction
0:27 - Motivation
0:52 - Problem Explanation
5:04 - What is Complete Graph ?
9:15 - Approach-1 (DFS)
18:32 - Coding DFS
22:40 - Approach-2 (BFS)
24:32 - Coding BFS
26:37 - Approach-3 (DSU by Size)
40:31 - Coding DSU by Size
#MIK #mik #Mik
#coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview#interviewtips #interviewpreparation #interview_ds_algo #hinglish #github #design #data #google #video #instagram #facebook #leetcode #computerscience #leetcodesolutions #leetcodequestionandanswers #code #learning #dsalgo #dsa #coding #programming #100daysofcode #developers #techjobs #datastructures #algorithms #webdevelopment #softwareengineering #computerscience #pythoncoding #codinglife #coderlife #javascript #datascience #leetcode #leetcodesolutions #leetcodedailychallenge #codinginterview #interviewprep #technicalinterview #interviewtips #interviewquestions #codingchallenges #interviewready #dsa #hindi #india #hindicoding #hindiprogramming #hindiexplanation #hindidevelopers #hinditech #hindilearning #helpajobseeker #jobseekers #jobsearchtips #careergoals #careerdevelopment #jobhunt #jobinterview #github #designthinking #learningtogether #growthmindset #digitalcontent #techcontent #socialmediagrowth #contentcreation #instagramreels #videomarketing #codestorywithmik #codestorywithmick #codestorywithmikc #codestorywitmik #codestorywthmik #codstorywithmik #codestorywihmik #codestorywithmiik #codeistorywithmik #codestorywithmk #codestorywitmick #codestorymik #codestorwithmik