Wow I was smiling in my mind when this happened - 26:36 So much so for being a student of MIT. . . Sorry for bad english .
@mrodriguezglobe4 жыл бұрын
thank you , you're the best
@MichaelBrashier8 жыл бұрын
I didn't know DFS when I was 7 but I did know BFS subconsciously. I used it to get home after riding all over town on my bicycle all day.
@ervinzhou82517 жыл бұрын
DFS might be a bit more handy in your case lmao.
@Maen9634 жыл бұрын
😂😂😂
@zaramomadi55693 жыл бұрын
I love this comment
@hkjpotato3 жыл бұрын
no how can u use bfs?u went to block a,then street 1, 2, 3 of block a, failed. Then you move to block b. Right?
@sergeykholkhunov18883 жыл бұрын
02:05 depth-first search 08:58 example 14:11 running time 18:03 edge classification 30:40 cycle detection 41:57 topological sort (job scheduling)
@neuron81863 жыл бұрын
"when I was 7 years old I did DFS without even knowing it"and here i am 20 yo banging my head against wall to understand topic
@ronitaryan54023 жыл бұрын
me too bro, me too
@perveenneha14233 жыл бұрын
God !!!!! you just spoke my mind........ even i am 20 and literally i am hell scared of all backtracking questions ......... infact i have skipped all of them ........ hell
@SanghoBose56 жыл бұрын
This has to be one of the best lecture in the series.
@mrodriguezglobe3 жыл бұрын
DFS Time Complexity: 14:10 Cycle Detection: 30:00 Topological Sort: 42:00
@siennahunter90435 жыл бұрын
"when I was 7 years old I did DFS without even knowing it" weird flex but ok
@doom96035 жыл бұрын
flex is real xD
@rj-nj3uk5 жыл бұрын
Yeah. I agree. But he is a prof at MIT and we are potatoes watching him teaching.
@BharCode094 жыл бұрын
@@rj-nj3uk Well, I'm a tomato!
@bartekpacia4 жыл бұрын
3:54
@grantfaith4 жыл бұрын
i lol'ed at his comment
@zulumopuku53704 жыл бұрын
These lectures are so easy to follow. Thanks alot MIT
@zaramomadi55693 жыл бұрын
Erik Demaine is amazing. His lectures are so fun to watch and easy to follow. I love his older lectures too but mannn his more recent ones are pure gold.
@booleangray22253 жыл бұрын
Any specific ones?
@ronthomas83319 жыл бұрын
when he was 7 years old he wrote a program to solve a maze using dfs, and that too without knowing it was dfs.WOW!!!.
@spandanhetfield9 жыл бұрын
+ron thomas He is the youngest prof in the history of MIT. He made a prof at around 20. Check out his wiki page :D
@ChrisLeeX8 жыл бұрын
+Spandan Madan That is friggin awesome. He has a geeky charisma about him as well.
@abaybektursun8 жыл бұрын
+Spandan Madan bruh
@jackll21498 жыл бұрын
He should be like one of the guys in big bang theory. The only difference is he is a real person.
@hanssarpei54298 жыл бұрын
f
@estebanlopez17014 жыл бұрын
Oh Lord, one of the brightest minds at MIT is saying that doesn't have a good memory, that's the only part of the lecture I didn't understand
@crjacinro4 жыл бұрын
he is a math genius. math doesn't need much memory. It needs intuition and logic.
@manishmberwani45410 жыл бұрын
Superb teacher...................Wish if all colleges students can see these videos and learn better!!!!
@JeewanthaBandara9 жыл бұрын
Manish M Berwani They can. :)
@manishmberwani4549 жыл бұрын
I have seen many colleges, where students never learn from internet!
@mohitnirwan98124 жыл бұрын
It'd be really cool, if people who attended this class like 10 year ago would come here to see this video :D
@BikasKatwalK4 жыл бұрын
Cycle Detection: 30:00 Topological sort: 42:00
@dragon_warrior_4 жыл бұрын
*IMDB Rating* : 10/10 for this whole 6006 series edit : + extra 100points for uploading the crispy notes
@MikeChaseJr4 жыл бұрын
I wish I was bold enough to wear a pony tail, a t-shirt, and jeans to teach class lectures. I love this man.
@ikaros97274 жыл бұрын
This man is truly amazing. Would be kinda interesting to see the textbooks MIT uses
@nathanaelfarciert7114 жыл бұрын
Ikaros97 According to the course website, CLRS is the textbook for this course
@ikaros97274 жыл бұрын
@@nathanaelfarciert711 Kinda funny because i use the same ^^ Its like everybody uses it but quite often its very mathematical and hard to understand
@HexagonalClosePacked4 жыл бұрын
Erik: When I was 7 year old, one of the first computer program I wrote was for solving a maze. .... Me: When I was 7 years old, I fast and furious with my new bicycle and ended up with stitches...(that's as impressive as I can get for a 7 years old me)
@Victor-yn6jm4 жыл бұрын
I was playing with mud when I was 7 years old
@sulakshanachakraborty12383 жыл бұрын
I was eating mud when I was 7 years old
@mindlessripoff2210 жыл бұрын
damn bruh shouts out to young demaine killing the algorithm game since a young'n!
@lambo27123 жыл бұрын
7 years old im trying to learn to read my native language and this man already master computer language
@nonsolomacintosh6 жыл бұрын
In the 2005 course there was Leiserson talking shit about python. Now: "this is python notation"
@ShingHim6 жыл бұрын
Seems like the camera man is asleep half of the time but great lecture!
@quidquopro11856 жыл бұрын
03:55 Have been sitting scratching my head the whole semester over graphs and algorithms and he drops this bomb on me 1 week before my exam. Thank you for the confidence boost mate.............................................................. (jk he is awesome :) )
@mehmetatabal69234 жыл бұрын
No people, that's legit he did that in 7. This guy was one of the child prodigies and he is famous for it. He got his PhD at the age of 20. What really surprised me was he said I have a terrible memory which is something that I would think every genius like him would have.
@mearaftadewos85082 жыл бұрын
that tells he has high expectation of himself
@gamingdork36814 жыл бұрын
Thank u for this amazing lecture my algo professors need to learn from u both way to teach and also get some knowledge as they are absolutely terrible.
@Chatbot1212 жыл бұрын
Breadcrumb analogy was perfect
@essamewaisha87466 жыл бұрын
Edge Classification 18:22
@brandoncruz120811 жыл бұрын
Wish I knew DFS when I was seven...
@jdleanne4 жыл бұрын
well i had my first c++ program written at age 25. Left that 10 yrs for other studies but still manage to work as a c++ developer during a postdoc fellowship. I don't think age matters but time management is a headache.
@souvikdas27596 жыл бұрын
the difference between a avg teacher and a great one is how do you communicate when students mistake. For ex: what is the time complexity? some said 'V'. He said ' A little optimistic' !! WOW !!
@mearaftadewos85082 жыл бұрын
Most teachers are egomeniac as my observation of their characters; they enjoy tearing down students' confidence with out providing much comprehendable explanations(most of the times). The best teachers don't thems self that seriously and tend to build students knowledge base and confidence at the same time.
@cesaredecal22304 жыл бұрын
Edit: he later corrected himself. Introduction to Algorithms (3rd edition) by T. Cormen says "We now show that forward and cross edges never occur in a depth-first search of an undirected graph". Then why did the professor say we have cross edges in an undirected graph?
@SajjadKhan2-m5b13 күн бұрын
What?
@dakotadanderson5 жыл бұрын
thank you from DePaul, MIT
@4blossoms10 жыл бұрын
Erik Demaine is hot! He makes any lecture 100 times more interesting!!
@jasonavina81353 жыл бұрын
This is a good lecture, but I think would be confusing for people that aren't already familiar with how a DFS works, which is simpler than it seems here. What I like about it is the how he shows the pseudocode for it and the reasoning behind that.
@lockersrandom61614 жыл бұрын
Thank You MIT.
@Augustinephillips11 жыл бұрын
I love Erik Demaine!
@TomerBenDavid5 жыл бұрын
topological sort 42:00
@capetaquebratudo6 жыл бұрын
I didn't know you could be extremely clever and didactic at the same time. Congratulations.
@dragon_warrior_4 жыл бұрын
adios
@w1d3r754 жыл бұрын
Check the parent and if it not visited, traverse recursively
@sicktastic.videos2 жыл бұрын
Professor Erik Demaine solved DFS when he was 7.... Dang.
@bogdantodasca20934 жыл бұрын
30:10 - after explaining tree / backward/forward edges - "So what?". Exactly what I was wondering
@joeyalfaro23233 жыл бұрын
God alone knows man's heart his thoughts we can only go by what we see or hear. Compation is rear commodity in world more rare gold.
@jimnewton45345 жыл бұрын
Doesn't a discussion of topological sort need to include mention of a tie-breaker function, and a discussion of whether the tie breaker guarantees a unique order which obeys the constraints? It seems to me, naively, that the DFS approach is insufficient with certain tie-breaker functions. It is a bit strange that both the lecturer and also Cormen [Intro to Algorithms, Thomas Cormen et.al] ignore the question of a deterministic topological sort. My first encounter with topological sort with with the linerarization of class precedence lists in object systems which allow multiple inheritance. It is of utmost importance that the the class precedence list be deterministically ordered.
@awesomefox46538 жыл бұрын
14:12 DFS time complexity
@evanshareef23974 жыл бұрын
O(V+E)
@samhitajoshi4 жыл бұрын
When I was 7, I knew how to backtrack and how to write.
@PratikShende9110 жыл бұрын
thanks for that,.......now m clear about the concept behind that...
@thinhnguyenvan70033 жыл бұрын
when I was 7 years old I did DFS without even knowing it" . Ok Its not too late for learning new things (Me at 29 and appease myself)
@HienNguyenTechIO4 жыл бұрын
Thanks MIT
@csl13844 жыл бұрын
14:53 "collaborative effort" LOL
@TothAndris9111 жыл бұрын
Thank you so much, it was very easy to understand!
@NytronX6 жыл бұрын
14:18 - Rundown of DFS (Figure 22.4) on pg. 605
@sianmuanthangmilun61048 жыл бұрын
He knew a smattering of DFS when he was 7 years old. Morale: Not all precocious geeks end up like Mark Zuckerberg.
@ShakkIsLife7 жыл бұрын
mark zuckerberg is a complete noob compared to erik
@dylancutler19786 жыл бұрын
Zuckerberg was a psychology major who's considered a tech genius because he wrote an app that sold well. All it was at the time was a few hundred lines of PHP. Erik is on another level.
@sizwesandile26448 жыл бұрын
Big YELLOW chalks prints White!
@BharCode094 жыл бұрын
That is yellow wrapper around white chalk i guess, to avoid sticking.
@vrindasinghal36544 жыл бұрын
That is the plastic chalk holder so the hands of the professor do not get dirty
@saadabouzahir86967 жыл бұрын
Parent dictionary has been declared in both function is it a global variable ? or the parent's function are different? because in DFS parents contain start vertex while in the seconde one it contains father of.. with only one source.
@nanwu44306 жыл бұрын
The parent map has to be global or pass down to recursive calls. Otherwise, it won't work.
@allandogreat2 жыл бұрын
We don't pay, but we get!
@IQisTwenty11 жыл бұрын
that's Erik ma boy
@neuron81863 жыл бұрын
ayo my boi are you ok its been 7 years how life goin?
@md.dilshadulislam91135 жыл бұрын
Humm my code was right as it was changing it's level and back level for each isolated components or for each non out degree vertices
@isabellehu92313 жыл бұрын
28:13 but what if we don't follow that first edge? well then we follow the second one. using your logic, that first "tree" edge is actually a "back" edge! i think that these edges are just a by-product of dfs and not for generic graphs without using dfs, if that makes sense. cheers :D
@이효건-o4o3 жыл бұрын
haha i was doodling on the maze when i was 7 years old
@sudhanshudey7583 жыл бұрын
In the graph shouldn't the arrow drawn on the edge be from B to D?
@andreibozantan10 ай бұрын
Is it OK to use recursive DFS for topological sort in practice? Or should we use a iterative implementation to avoid possible stack overflows?
@jimnewton45345 жыл бұрын
To further beat a dead horse, the discussion of forward/cross/backward edges is a bit confusing, and not exactly well defined. Perhaps it is better defined in the text book the lecturer keeps referring to. For example, there is a looping edge from f to f. If you mark nodes in lineage list using the method explained in the lecture (via started-examining finished-examining advise), then the loop edge will point to a parent node (by that algorithm), and thus be a backward edge. Is this the intent?
@panfayang11 жыл бұрын
i want a cushion, too.....
@JesseLH883 жыл бұрын
I also played with trees at 7... real trees, like the wooden kind.
@SajjadKhan2-m5b13 күн бұрын
💀
@JonLee1084 жыл бұрын
36:06 - what is the difference between "where we start the search" and "the first vertex that is hit by the DFS?" thanks!
@zeronothinghere93344 жыл бұрын
You can start your search earlier, then go over v1 to vk, before you hit v1 again. That is meant with "the first vertex that is hit by the DFS", basically, the first time you do DFS on a node that has already been visited before by that same search.
@hbaduk7 жыл бұрын
where is lip gallagher
@yuf23165 жыл бұрын
What if the first node you visit in DFS is some node in the middle and can never reach its parent? wouldn't its parent be set to none and never corrects?
@mikey.audio. Жыл бұрын
I was never able to learn like this. How is it possible to take notes AND simultaneously learn a new complex topic? The time complexity of this teaching method is like O(n!). You literally have to wait until the professor reads his notes and writes it on the board before you can then read it and write it in your notebook, only to then have to read it again later because you were too busy taking notes to learn it. There's so much more I can say, but I'll leave it at that. I'm only here to remind myself of how useless lectures were for me. I learned by reading the textbook.
@joeyalfaro23233 жыл бұрын
No I understand I loved algebra and geometry puzzles never understand what equals sign ment. Never even fazed me best way to learn anything pic good tracher
@MrSmokey2474 жыл бұрын
Isn't determing back edges for right and left just a matter of perspective? I don't really understand how the two algorithms for left and right back edges differ..
@muslimx62638 жыл бұрын
I don't know how to thank you.. just thanks
@zulumopuku53704 жыл бұрын
He mentioned a book. what book is that ? @MIT openCourseWare
@mitocw4 жыл бұрын
The textbook for the course is Cormen, Thomas, Charles Leiserson, Ronald Rivest, and Clifford Stein. Introduction to Algorithms. 3rd ed. MIT Press, 2009. ISBN: 9780262033848. See the course on MIT OpenCourseWare for more info and materials (lectures notes, exams with solutions, assignments with solutions) at ocw.mit.edu/6-006F11. Best wishes on your studies!
@thejassai85927 жыл бұрын
12:20 D is a parent to nothing,so it is'nt in the parent [ ].So how do we know that it's already been visited?
@JiancongXie3 жыл бұрын
The student are so coooool when the teacher want democratic math, the total number of hands-up doesn't exceed 10..... Really similar as my student age, most students are sleep when taken algorithm course.
@VedhasDeshpande9 жыл бұрын
This guy is so cool! \m/
@Di5TuRBeD10 жыл бұрын
3:15 theoddone
@jossef1211 жыл бұрын
Well explained!, Thanks.
@abaybektursun8 жыл бұрын
Thank you!
@giaple62374 жыл бұрын
Explanations are a little bit convoluted, particularly the codes. I think this lecturer does not like but has to follow the textbook.
@LordMoopCow4 жыл бұрын
yeah but do you have a dfs on rs mate
@randy44433 жыл бұрын
How would I choose the starting node?
@salexkorsan87903 жыл бұрын
I need help, I want to sort in bash file, Example.... a="10" b="100" C="1000" I want to sort this $a $b $c How to sort ?? Max value between this
@debasismandal19244 жыл бұрын
when i was 7 years old i wrote hello world without even knowing it was hello world
@eightball80087 жыл бұрын
8:30 in the parameters for DFS, are those commas between| V and Adj or are they little n's?
@macdondb4 жыл бұрын
Commas. He does kind of backwards commas
@guywithaname54086 жыл бұрын
17:15 Erik becomes Markiplier
@teckyify6 жыл бұрын
The part with the edges was chaotic, still don't know what's what.
@rj-nj3uk5 жыл бұрын
Yes he totally confused me on that undirected edge part.
@ankursatya47337 жыл бұрын
@ 28:35 why would we follow the edge from the 2nd node from ''S' back to 'S' in case of undirected graph?
@FantomX9327 ай бұрын
Why does he uses paper? He does not keep in the head these ideas?
@mohansinghrawat43247 жыл бұрын
thankyou sir....
@РоманБожко-ф6й7 жыл бұрын
Hello, everyone. I have a question about forward edge. The lecturer said that a forward edge is a node->descendant, but, imho it shouldn't be tree edge of the ancestor. So, if we write an edge from b to g - that one will be a forward. Am I right? Thanks for responses.
@aryangoyal58234 жыл бұрын
descendant word applies only when node is a tree edge of that ancestor
@pnachtwey6 жыл бұрын
I like this instructor better than the other one but both always take too long stating the obvious. I would start by asking "why bother?" Where would you use a graph? Why would you use a depth first search over a breadth first search? What about cutoffs?
@simplyajith14 жыл бұрын
46:20. why ? who knows? , Let's prove it.
@davidFbeckham5 жыл бұрын
Thanks my dawg
@bharathkotha8 жыл бұрын
why do we need V as an argument in DFS-Visit method ?
@xinliangzhu69447 жыл бұрын
It's the set of vertices.
@NiGhTzz29037 жыл бұрын
In case someone else has the same question, he said at 5:18 that the V doesnt have to be there in the argument and the students can erase it.
@mohansinghrawat43247 жыл бұрын
i think text book u have is cormen lieserson
@tayyabmughal100003 жыл бұрын
He wrote DFS algo when he was 7 years old . .....😬😬
@linkon_10 жыл бұрын
in DFS node goes from A to B and A to C Doesn't make B and c siblings?? When explaining types of edges @21:00 If node d is traversed first then node b and then node e and then node g when you draw an edge between G and C how it make crossed egde?? It should be backward and .. Cross edge should be like edge from F to itself.. ???
@Joshuaposada9 жыл бұрын
Linkon Manwani How does it go from A to C? if there was a line connecting them then it would be a cross edge and yes as sub tree they would be siblings.