Русские видео

Сейчас в тренде

Иностранные видео


Скачать с ютуб Remove Max Number Of Edges To Keep Graph Fully Traversable | Leetcode - 1579 | DSU | GOOGLE | Live в хорошем качестве

Remove Max Number Of Edges To Keep Graph Fully Traversable | Leetcode - 1579 | DSU | GOOGLE | Live 1 год назад


Если кнопки скачивания не загрузились НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием, пожалуйста напишите в поддержку по адресу внизу страницы.
Спасибо за использование сервиса savevideohd.ru



Remove Max Number Of Edges To Keep Graph Fully Traversable | Leetcode - 1579 | DSU | GOOGLE | Live

This is the 25th Video on our Graph Playlist. In this video we will try to solve a Hard but a very good Graph problem "Remove Max Number of Edges to Keep Graph Fully Traversable" (Leetcode-1579). I am promising you, this problem will become easy once you are done with this video. If you have been following my "Graph Concepts & Qns" playlist , then these Qns will become very easy. Find the Link for that below. Problem Name : Remove Max Number of Edges to Keep Graph Fully Traversable Company Tags : GOOGLE My solutions on Github : https://github.com/MAZHARMIK/Intervie... Leetcode Link : https://leetcode.com/problems/remove-... 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...   My GitHub Repo for interview preparation : https://github.com/MAZHARMIK/Intervie... Instagram :   / codestorywithmik   Facebook :   / 100090524295846   Twitter :   / cswithmik   Subscribe to my channel :    / @codestorywithmik   ╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗ ║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣ ╠╗║╚╝║║╠╗║╚╣║║║║║═╣ ╚═╩══╩═╩═╩═╩╝╚╩═╩═╝ ✨ Timelines✨ 00:00 - Introduction 0:55 - Problem Explanation 5:25 - Why DSU ? 7:30 - Applying DSU 17:48 - Story Points 19:13 - Coding it up Summary : The problem involves determining the maximum number of edges that can be removed from a graph while still maintaining connectivity for both Alice and Bob. The solution uses the Disjoint Set Union (DSU) data structure to efficiently manage and merge connected components. DSU Data Structure: Two instances of the DSU are created, one for Alice and one for Bob. The DSU supports find and union operations with nearly constant time complexity due to path compression and union by rank. Edge Processing: The edges are sorted in descending order based on their type to prioritize type 3 edges, which are common to both Alice and Bob. Each edge is processed: For type 3 edges (shared by both Alice and Bob), the edge is added to both DSUs if it connects two different components. For type 2 edges (Bob only) and type 1 edges (Alice only), the edge is added to the respective DSU if it connects two different components. Counting Added Edges: A counter tracks the number of edges successfully added to the DSUs. The difference between the total number of edges and the number of added edges gives the maximum number of removable edges. Final Check: After processing all edges, a check ensures both Alice's and Bob's graphs are fully connected (i.e., each has only one connected component). If both graphs are fully connected, the result is the number of removable edges. Otherwise, it's impossible to achieve the required connectivity, and the result is -1. #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 #newyear2024

Comments