actually bonus has been asked in my interview round of algouniversity so it should be in important one and dijkstra is very much common and asked in interview
The time complexity of graph traversals is actually O(V + E), where V is the number of nodes, and E is the number of edges. Graph traversals are only (n) when the graph is a tree with a fixed amount of children(like a binary tree)
@@anonymoussloth6687 Hey sorry for responding kind of late, but think of the graph as an adjacency list/hash-map. If you want to traverse the entire graph, you need to traverse each key(vertex) and every value (edge). Therefore, the time complexity is O(V + E)
Thanks for the informative videos. Just a small correction about the time complexity of DFS and BFS: it is not O(V) where V is the number of nodes, but O(V+E), where you should consider the edges as well.
Hey i know bfs ,dfs topo,dijkstra but don't know Floyd warshall prim kruksal right now should i could follow neetcode graph playlists i am tired of just learning new algos i want to solve question to particular these algos after solving some questions i will move to others algos could you guide ?
The algorithms were created for optimizing software, deliver efficient solutions, but nowadays most of the companies use them to filter out candidates in job interviews and look cool🤦🏽♀️, once you get into the company you probably are not going to hear about that never again
Topological sort is IMHO less obscure than Union Find or Dijsktra's. The latter are more well known by name because they are illustrative for didactics, e.g. Union Find is the first major algorithm introduced in Sedgewick's book as a case study, before returning to a more orderly review of algorithms. Topological sort is, conversely, is an extenstion to a wide variety of well known practical problems like ordering a course schedule or execution of project or (automated) job dependencies. Cracking the Code Interview even argues you should be able to derive it on the spot if you didn't know it (I disagree but shrug). Its a minor point but I think people might see it and think they should study it last, where as IMHO its more expected knowledge than Dijkstra's and also really easy to understand once you've done a few DFS problems!
BFS + topological sort is more complex but feels more intuitive (to me). There's more code as you need to manage "in degrees" (the number of incoming edges to a node) and you need a queue (common in BFS).
Great set of problems! Are the problems sorted in order of importance/frequency encountered (IE DFS most important/frequent, Djikstra's algo least important/frequent)?
At 5:22 you say "which is how I was taught" so could you let us know who taught you and how you started to come up with these approaches to solve all these problems?
You can implement topo sort either way, doesn't really matter. Either use BFS, "remove" edges by subtracting indegrees on vertices and add when indeg[u] = 0, or just build the DFS tree.
You can implement topo sort either way, doesn't really matter. Either use BFS, "remove" edges by subtracting indegrees on vertices and add when indeg[u] = 0, or just build the DFS tree.
Hi can any one help me here, I used to be python coder but got laid off in April and now I want to switch into more development side I am doing dsa only for sometime what other skill should i focus on
🚀 neetcode.io/ - I created a FREE site to make interview prep a lot easier, hope it helps! ❤
Unfortunately VMv4 doesn't work when redeemed as a coupon
@@DennisWanyonyi qqqqqq++q++qqqqq+qqq++qqqqq+++qqqqqqqqqqqqqqqqq11q+qq
@@DennisWanyonyi q+qqqqqq++++q+qqq+q+qq+++qqqqqq1q++q+qqqqq+++++++++++++++
1) DFS
2) BFS
3) Union Find
4) Topological Sort
5) Dijkstra's Algorithm
Bonus (Not as frequently asked)-
1) Prim's/Kruskal's Algorithm (MST)
2) Floyd Warshall's Algorithm
actually bonus has been asked in my interview round of algouniversity so it should be in important one and dijkstra is very much common and asked in interview
Dude I sincerely can't thank you enough. I'm studying for job interviews and your content is the only reason I feel semi-confident going into them
semi confident lmfao.btw ALL THE BEST.
Lol I feel you, thank you @NeetCode
I make these words my own.
Did you get the interview?
bro did you land in a job ?
The time complexity of graph traversals is actually O(V + E), where V is the number of nodes, and E is the number of edges. Graph traversals are only (n) when the graph is a tree with a fixed amount of children(like a binary tree)
Can u explain how it is V+E in detail?
@@anonymoussloth6687 Hey sorry for responding kind of late, but think of the graph as an adjacency list/hash-map. If you want to traverse the entire graph, you need to traverse each key(vertex) and every value (edge). Therefore, the time complexity is O(V + E)
JUDA FROM CSCAREERSDEV?
@@simonchristian160 yessir
Thanks for the informative videos. Just a small correction about the time complexity of DFS and BFS: it is not O(V) where V is the number of nodes, but O(V+E), where you should consider the edges as well.
Ur playlist is the reason I feel confident with Graph questions. Thanks Man!!
Hey i know bfs ,dfs topo,dijkstra but don't know Floyd warshall prim kruksal right now should i could follow neetcode graph playlists i am tired of just learning new algos i want to solve question to particular these algos after solving some questions i will move to others algos could you guide ?
i think it’s pronounced dye-kstras algorithm btw
🤓☝️
Witcher 3 also has a character named dijkstra.
Dyke straw lol
Yea and they pronounce him dee 'k stra. After playing it, i always called it that calling others pronunciation as uncouth
Yup he was from Netherlands
It’s d
The algorithms were created for optimizing software, deliver efficient solutions, but nowadays most of the companies use them to filter out candidates in job interviews and look cool🤦🏽♀️, once you get into the company you probably are not going to hear about that never again
This is 100% correct.
Topological sort is IMHO less obscure than Union Find or Dijsktra's. The latter are more well known by name because they are illustrative for didactics, e.g. Union Find is the first major algorithm introduced in Sedgewick's book as a case study, before returning to a more orderly review of algorithms. Topological sort is, conversely, is an extenstion to a wide variety of well known practical problems like ordering a course schedule or execution of project or (automated) job dependencies. Cracking the Code Interview even argues you should be able to derive it on the spot if you didn't know it (I disagree but shrug). Its a minor point but I think people might see it and think they should study it last, where as IMHO its more expected knowledge than Dijkstra's and also really easy to understand once you've done a few DFS problems!
damn bro you really are just talkin. Power to u brudder
Its really helpful that you categorize every problem and made a separate folder
Just fyi, the Di in Dijkstra is pronounced like Di in Dice
Thanks for the video
Witcher 3 players would know
Only bez of Ur playlist is the reason i think i will get a good job . absolutely wonderful videos on DSA . I lov u bro.
One of the best interview preparation channel
It's a remainder that you are doing amazing 😁👍🏻
Because of your content..I feel confident while giving interview...huge respect❤
Why isn't Top Sort BFS since it looks like you are doing level order traversal?
BFS + topological sort is more complex but feels more intuitive (to me).
There's more code as you need to manage "in degrees" (the number of incoming edges to a node) and you need a queue (common in BFS).
Shouldnt topological sort use bfs? Since we would have to print all nodes that are at the same level or depth before going further?
Yeah you're right, I think most people do bfs, but I usually do it dfs which is more simple imo (I used dfs for the alien dictionary problem)
What about Bellman Ford or Floyd Warshall Algo
this content is gold, man
Great set of problems! Are the problems sorted in order of importance/frequency encountered (IE DFS most important/frequent, Djikstra's algo least important/frequent)?
7:33 isn't topological sort actually identical to BFS?
Yeah that's what I think as well🤔
In that case yes, but because he picked a bad example.
Topo could be extended by both dfs and bfs(also called as khan's algo)
We need a video for LeetCode 1319!
At 5:22 you say "which is how I was taught" so could you let us know who taught you and how you started to come up with these approaches to solve all these problems?
would highly appreciate if you can solve 636. Exclusive Time of Functions
You are the best! Thank you soooo much)
You mention a lot hashset is there any video recommended to learn about that data structure? Most focus on implementation
hello everyone,, lets write some neetcode today.
Nice topic! Thanks
upload more videos on graphs sir
I know bfs ,dfs,topo sort dijkasta and uninon find little bit too should i start solving questions ?
Why so less subscribers dnt know
What about bellman ford's algo? Not so common?
time complexity of dfs isn't O(V+E)?
Good One.
Does topological sort use dfs or bfs? From explanation it’s describing bfs 😮
@neetcode
You can implement topo sort either way, doesn't really matter. Either use BFS, "remove" edges by subtracting indegrees on vertices and add when indeg[u] = 0, or just build the DFS tree.
Thankyou so much
shouldn't topological sort be BFS and not DFS? (minor error?)
You can implement topo sort either way, doesn't really matter. Either use BFS, "remove" edges by subtracting indegrees on vertices and add when indeg[u] = 0, or just build the DFS tree.
Hello, for the generic DFS method, should we use void or returning something?
Hi can any one help me here, I used to be python coder but got laid off in April and now I want to switch into more development side I am doing dsa only for sometime what other skill should i focus on
no one traverses my lair except me
Dijkstra in school??? Noway...😂😂😂
LEGEND!!!
thank you . and I would like to see your face
i only hear mouth sounds on this video....