Graph Search Algorithms in 100 Seconds - And Beyond with JS

Graph Search Algorithms in 100 Seconds - And Beyond with JS

Fireship

4 года назад

264,073 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@Fireship
@Fireship - 25.04.2020 19:08

Do you want to see more videos with a technical "interview prep" focus? Usually I cover practical projects, so curious to know what you think...

Ответить
@tusharsingh7926
@tusharsingh7926 - 03.10.2023 20:54

Thank You So Much for this wonderful video...🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

Ответить
@joaotextor4094
@joaotextor4094 - 28.09.2023 16:56

Amazing video!! Practical problems are ALWAYS better than abstract ones.

Ответить
@rishav.bharti
@rishav.bharti - 07.09.2023 22:14

A course on DSA please

Ответить
@lucasoliveira-xs5yh
@lucasoliveira-xs5yh - 21.08.2023 15:59

Your channel is sooooooo awesome, congratulations! One question that I have: Is the set used at the DFS function a memoization technique?

Ответить
@user-ft5or1uh7m
@user-ft5or1uh7m - 03.08.2023 08:28

did you post the code somewhere?

Ответить
@Diego-Garcia
@Diego-Garcia - 15.07.2023 07:51

Very good video. I implemented in Go for myself, and turned out it was DFS 😂

Ответить
@dhirajdeore434
@dhirajdeore434 - 30.06.2023 02:29

more algorithms PLEASEEEEEEEEE !!!!!!!!!!!!!!!!!!!!!!!

Ответить
@June_Yue
@June_Yue - 14.06.2023 18:01

Thank you!This taught me more in a few mins than my professor in hours!

Ответить
@carcamp5451
@carcamp5451 - 02.05.2023 13:28

This channel is a gem

Ответить
@Eduardo-cr8ri
@Eduardo-cr8ri - 22.04.2023 07:13

The beginning feels like Gordon Ramsay made it. Love is!

Ответить
@hendrickmanenga9213
@hendrickmanenga9213 - 07.04.2023 18:13

Some people were really born to teach.Congrats

Ответить
@Jonathan-rm6kt
@Jonathan-rm6kt - 07.04.2023 04:13

Graph theory… the only class I almost straight flunked in college and still shiver thinking about. Maybe it’s easier now with code, but in theory it’s confusing AF

Ответить
@bryanlee5522
@bryanlee5522 - 28.02.2023 05:44

I wish it wasn't so zoomed in and double spaced

Ответить
@priyankanispro
@priyankanispro - 29.01.2023 11:57

this video is 629 seconds long

Ответить
@mfundosindane6975
@mfundosindane6975 - 29.01.2023 00:59

Please do more videos like these

Ответить
@golddropper2747
@golddropper2747 - 17.01.2023 17:38

Very clear instructions. I only know Python and I completely understood your coding process with Javascript.

Ответить
@samuelmaucaille702
@samuelmaucaille702 - 17.01.2023 06:37

Quality

Ответить
@alexmercerind
@alexmercerind - 13.01.2023 12:32

man this is gold

Ответить
@code2287
@code2287 - 08.01.2023 14:50

Add start to initial set in bfs to avoid an extra search of the node you started with

Ответить
@arjunyonzan8557
@arjunyonzan8557 - 14.12.2022 11:07

thank you, will be practising a lot

Ответить
@anishkarthik4309
@anishkarthik4309 - 10.11.2022 15:52

wow so fantastic, so fast and all necessary details/CRITICAL details are covered with real time application.

This really makes me so excited to dig deeper into the topic.

Keep posting more informative videos like this.
And could be also attach code in the video description in popular 3 languages like python, Java, c++ along with javascript

Ответить
@akashmelkeri
@akashmelkeri - 02.11.2022 18:51

tried a lot not to laugh, but couldn't control everytime he said 'bangcock'

Ответить
@mithileshjoshi3942
@mithileshjoshi3942 - 17.09.2022 03:25

Intresting

Ответить
@albertoramos8341
@albertoramos8341 - 12.09.2022 11:34

Phenomenal content, thank you so much!!
Just have one question:
In the implementation of the BFS algo, the starting node should also be added to the visited Set before the while loop starts, right?

Ответить
@mohsinejaz6882
@mohsinejaz6882 - 09.09.2022 13:33

Fatastic .... 1 minute .... my full page is covered with expensive knowledge ..... How good you are ❤. It make me think of how much knowledge creator fed in you..... brilliant

Ответить
@fays_bn4321
@fays_bn4321 - 07.09.2022 21:19

Shouldn't dfs(destination, visited) be precede by return dfs(destination, visited) ?

Ответить
@BGivo
@BGivo - 02.09.2022 20:55

For the DFS approach, don't we need a check for the exit base case? (Something like 'if start != null") Or is it ok because we're using JavaScript and it will kind of fail semi-gracefully on its own anyway?

Ответить
@alexanderzelenkov6944
@alexanderzelenkov6944 - 24.08.2022 07:03

cool!

Ответить
@Tesseract9630
@Tesseract9630 - 15.08.2022 12:59

i wrote the same program are it is giving me this error ."Cannot read properties of undefined (reading 'push')".occuring at adjecencyList.get(destination).push(origin);

Ответить
@OEThe11
@OEThe11 - 07.08.2022 02:49

In 10 Min, I came out with a better understanding of graphs then I have in the previous attempts (which was a lot). Thanks for making graphs make sense.

Ответить
@arvinds8180
@arvinds8180 - 31.07.2022 06:01

CREDITS: goto (stackoverflow)

const airports = "PHX BKK OKC JFK LAX MEX EZE HEL LOS LAP LIM".split(" ");

const routes = [
["PHX", "LAX"],
["PHX", "JFK"],
["JFK", "OKH"],
["JFK", "HEL"],
["JFK", "LOS"],
["MEX", "LAX"],
["MEX", "BKK"],
["MEX", "LIM"],
["MEX", "EZE"],
["LIM", "BKK"]
];

const adjacencyList = new Map();

function addNode(airport) {
adjacencyList.set(airport, []);
}

function addEdge(origin, destination) {
adjacencyList.get(origin).push(destination);
const dest = adjacencyList.get(destination);

if (!dest) {
addNode(destination)
}
adjacencyList.get(destination).push(origin);
}

airports.forEach(addNode);

routes.forEach(route => addEdge(...route));

console.log("result");
adjacencyList.forEach((value, key) => {
console.log(key, value);
});

Ответить
@maryshiranig
@maryshiranig - 28.07.2022 22:56

Quick Question: doesn't the function execution should stop after it hit 'Return'? why does the output shows JFK to LOS after it actually found the "BKK".

Ответить
@Chandankumar-qw6hb
@Chandankumar-qw6hb - 28.07.2022 11:01

thanks

Ответить
@opeyemijonah8530
@opeyemijonah8530 - 06.07.2022 08:00

Bro! The way you explained this and the neatness of your codes I could grasp the Graph theory quickly. Please make a series.

Ответить
@Centori88
@Centori88 - 16.06.2022 17:26

This is such a great video!Thank you!!!!

Ответить
@emmalopez5805
@emmalopez5805 - 04.06.2022 18:42

this actually just helped me in a FANG interview, great stuff!

Ответить
@ritambanerjee3668
@ritambanerjee3668 - 01.06.2022 21:53

TBH BFS actually guarantees a solution (if it exists) and gives you the shortest path (if implemented correctly), so I guess to check if a path exists both BFS and DFS can work but if you want to find the shortest path use BFS.

Ответить
@CodeMonkeyG2011
@CodeMonkeyG2011 - 14.05.2022 04:51

The format of these videos is brilliant! 100 seconds intro and then, if you want it, some practical implementation.

Ответить
@brNoMundo123
@brNoMundo123 - 24.04.2022 04:20

Amazing vídeo!

Ответить
@TarekFaham
@TarekFaham - 08.04.2022 08:19

That was great stuff...! Can you make a video about representing a graph for course dependencies, and if the dependencies have a cyclic reference or loop.

Ответить
@coolj7086
@coolj7086 - 02.04.2022 09:18

Really nice video! Although using map and set do add a O(logV) factor in the final complexity and, depending on how js handles popping elements from the front of the array, an O(V) factor

Ответить
@jasonlantz3808
@jasonlantz3808 - 24.03.2022 19:31

linear time based on edges... linear space based on nodes... O(n), O(m), respectively...

Ответить
@legendaryseoking6685
@legendaryseoking6685 - 17.03.2022 01:19

dam this is so much more helpful than the leetcode graph card, thank you so much!

Ответить
@joshwasuresh6445
@joshwasuresh6445 - 08.03.2022 22:52

He just solved the most difficult problem in the world 😳...

Ответить
@HardeepSingh-de8hi
@HardeepSingh-de8hi - 08.03.2022 16:04

🔥

Ответить
@Videosuser
@Videosuser - 02.03.2022 06:06

amazing

Ответить
@LeonardLuzon
@LeonardLuzon - 23.02.2022 22:24

Hello, feeling newb here. where did u initialized the "steps" variable at?

Ответить
@chitransh118
@chitransh118 - 23.02.2022 12:12

Please lower down background music

Ответить