filmov
tv
Word Ladder | Leetcode #127
Показать описание
This is a very famous and important problem in graph algorithm which is the word ladder problem and it is from leetcode #127.This problem is a tricky graph problem which can be solved using a set, queue and using BFS algorithm.DFS can't be used for this problem because that can have exponential number unique paths in a graph.We can use either DFS or BFS to find shortest path in Tree but we need to use BFS for finding shortest path in graph due to polynomial time of BFS.I have first explained the problem statement with all the constraints and then I have shown the observations and intuition for solving this problem.After this, I have shown the dry run using SET and BFS algorithm using queue.At the end of the video, I have also shown the code walk through for the solution.CODE LINK is present below as usual. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)
========================================================================
Join this channel to get access to perks:
=======================================================================
USEFUL LINKS:-
#graph #graphalgo #leetcode
========================================================================
Join this channel to get access to perks:
=======================================================================
USEFUL LINKS:-
#graph #graphalgo #leetcode
Комментарии