This is like a brute force approach to find the shortest distance. Even if we want to find the shortest distance between every pair of vertices, Dijkstras still does the job in VElogV which is less than Floyd warshall.
Thank you so much bhai..Can't appreciate you enough ❤💙❤ Java Implementation: class Solution { public void shortest_distance(int[][] grid){ int n = grid.length; //convert -1 to infinity --> easier min calculation for(int i=0; i
Bhaiya,yeh jo negative edge cycle vali dikkat hai yeh sirf jab i aur j ki value same hai tabhi encounter hogi??? doosre vertices ke liye negative edges ke case mein yehi dikkat nhi hogi kya??
hello mik, mai is year ke starting se roz kr raha hu questions , confidence bhi aagya hai kyuki mostly questions ban rhe hai aajkal mid-high level me , but chance nhi mil raha yaar kahi pe , interview tak hi agar na pohch paau to kya fayda dsa aane ka
Hi Kartik, Trust me , we all have been there. Everyone have faced this. But the motive is to never stop, You will definitely reach your goal. Rise and don’t stop ❤️
Best explanation 👍
Thank you so much ❤️❤️
Shared this channel to my whole college friends
Best Tutorial but very much underrated. Appreciate your work.
It means a lot to me.
Thank you so much 🙏🙏
I binge watched this whole playlist and this is the best graph playlist I ever found online
Via part made this algo super easy, awesome way to teach algos!!!
I never thought that Floyd Warshall algorithm will be this simple !!!
Thanks for amazing explanation, MIK Sir 🙏
Super Crisp explanation..binge watched whole series kind of addicted to your explaination 😍
Wow.
Thanks a lot for binge watching ❤️❤️😇😇
It's always refreshing to learn from your videos!!!!
Brother i have seen striver's video on this , but your is Best , most underrated channel on DSA
the best part of every vdo is first 1 min
Floyd bhaiya bahut tezz the🔥🔥
god level explanation bro.
Okay, either this was easy or you are a great teacher. Win-Win for me😁😁
this is most underrated channel , he teaches amazing man 😀😀
Means a lot ❤️❤️🙏🙏
awesome explaination till now on youtube
thank you bhaiya .. after watching your videos now I don't just solve problems but I can write clean code
So happy to hear that 🙏😇
The motivation in the start 🔥🔥
The best explanation . Waiting eagerly for the next video on this playlist.
This is like a brute force approach to find the shortest distance. Even if we want to find the shortest distance between every pair of vertices, Dijkstras still does the job in VElogV which is less than Floyd warshall.
Hats off to you for this amazing explanation !!!!!
Thank you so much 😇🙏❤️
Best resource on internet
32/40 done ✅ thanks a lot bhaiya❤✌
Thank you 😇🙏❤️
Thank u so much for detailed playlist.
Can u also explain 847 leetcode using this approch
Sure Sandhya. Noted.
Thanks for watching
sab kuch sahi chlra tha but bhaiya time complexity ne apni aukaaat dikha di :)n^3
Ha ha. 🤣 Yeah. But many times, in contest qns, for small test cases Floyd Warshall comes to rescue 😍
yes bhaiya ! thanku for your crystal clear explanation@@codestorywithMIK
Thank you so much bhai..Can't appreciate you enough ❤💙❤ Java Implementation:
class Solution
{
public void shortest_distance(int[][] grid){
int n = grid.length;
//convert -1 to infinity --> easier min calculation
for(int i=0; i
❤️❤️❤️
keep it up bhai
Very helpful ❤
A little different implementation
class Solution {
public:
void shortest_distance(vector& arr){
int n = arr.size();
for (int via = 0; via < n; via++) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (arr[i][via] != -1 && arr[via][j] != -1) {
int new_cost = arr[i][via] + arr[via][j];
if (arr[i][j] == -1) {
arr[i][j] = new_cost;
} else {
arr[i][j] = min(arr[i][j], new_cost);
}
}
}
}
}
}
};
32/41 DONE [7.12.23] ✅✅
sir, please also share this notes that you prepare during the lecture.. for faster revision ...
do you know sometimes your bhashad is exactly i wanna hear at that moment
Scary things Made Easy by MIK
Bhaiya,yeh jo negative edge cycle vali dikkat hai yeh sirf jab i aur j ki value same hai tabhi encounter hogi??? doosre vertices ke liye negative edges ke case mein yehi dikkat nhi hogi kya??
i understood , but what is the derivation or intiuation for it,
matlab floyd uncle ne aisa kaise soch liya...would be interesting to know
hello mik, mai is year ke starting se roz kr raha hu questions , confidence bhi aagya hai kyuki mostly questions ban rhe hai aajkal mid-high level me , but chance nhi mil raha yaar kahi pe , interview tak hi agar na pohch paau to kya fayda dsa aane ka
Hi Kartik,
Trust me , we all have been there.
Everyone have faced this. But the motive is to never stop,
You will definitely reach your goal. Rise and don’t stop ❤️
thanks
Class solution {
Public void shortest _dis(int [][] matrix){
int INF=interger. MAX-VALUE, n=matrix. length;
for(int i=0;i
this is unknowingly bottom up dp.
इस को रट्टा लगवाना कहते है😂😂😂😂😂😂, बस steps रट लो और लो हो गया😂😂😂😂😂और कॉमेंट्स सब तालिया भी बजा रहे है 😂😂😂😂😂