Afrikaans
Akan
Albanian
Amharic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
In the last video you saw how I walk through how to do a breath first search in this video.
I'm going to explain how depth first search works and what depth first search is is a nother kind of
searching algorithm and it has some very different applications than breath first search and you'll
see how it works.
When I walk through the actual visualization and one other thing you may if you're familiar with the
video I did on post order binary search tree traversals.
You're going to see a few similarities between that and this.
So I'm going to start off by giving you the properties and what the properties are is you start at the
root and you follow the leftmost branch of the tree as far as possible until you either find the new
you you're looking for or you hit a leaf node.
So as you can see right here we if we start at the root and give that one we follow
the leftmost branch so we have a 1 2 3 and a 4.
So now we had our leafnode and the second property is if a leaf node is hit continue the search at the
nearest ancestor with unexplored children.
And so this is a recursive call.
And so what it will do is there are no more nodes here because four is a leaf node.
So instead we get turn around and go with the closest ancestor which is going to be right here because
this is a ancestor is a child of three.
And so this will be five.
This will be the sixth item that we visit and then we'll go up to 7 8.
And now that we're 8 Remember we have this recursive call.
So if you ever wonder where you're going to go from here remember were always going to go to the left
most note possible.
So we're going to come down here to nine ten now.
10 is a leaf node.
So we simply go to 11 and 12 and that's it.
So this is how to do depth first search as you can see it's very different than breadth first search
where as with breath first search we started at the root followed down to this level to the third level
into the fourth.
And some of the numbering differences this is the root is always one.
But in the infer breath first search this eight was actually a four because it went one two three and
then four right here.
So that's a very important thing to know depth first search has a completely different use case then
breath first.
There are both data structures or algorithms that are extremely popular for certain applications.
I personally don't I haven't really found a need to use breadth first search or depth first search in
and day to day development but that's mainly because I build out Web applications and mobile applications
and these usually aren't used for camping or more just things that you learn to learn more about computer
science and algorithm development so they're good to have a solid understanding of but they're not things
that you're going to use on a day in day out basis unless you focus in on that as a specialty so that's
depth first search.
Please let me know if you have any questions whatsoever and I'll see the next video.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.