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
So far we've talked about traversing a binary tree adding to a tree deleting from a tree but there's
a few other things that it's important to know especially if you're taking an algorithm class or you're
needing to create a good visualization for search and that's what binary trees are great for and the
very first thing we're going to do in this tutorial is go over what's called a pre order traversal.
And there is a few properties associated with it.
And I'm going to walk through the way the process works on the sample binary tree right here.
So the very first thing that you're going to do in a preorder traversal is visit the root.
So right here you can see that the root is 7.
And so we're going to traverse a tree and actually put this into an array appear at the top.
So for the array we're going to start off in or just say the first value we get is 7 because we're traversing
a tree and pre order the next step is actually to move to the left.
So we would move to this one value right here and we'd put this one in the array.
From there we would go further down to the left and get zero.
Put that in the array and then we're just going to keep on going down the list so now we're going to
come back up because zero doesn't have any children.
It's leafnode.
So then we're going to go over to three.
And so three is going to be the next value.
And from there we have to
and then back up to 3 and back down to 5 and evens is pretty straightforward it's more a process of
understanding just how it works.
But still finish this one out so you can see it.
So from five go down to four and then go back up to 5 and then go to six.
And so we've completed the left side of the binary search tree.
So now that we've done that we traverse all the way back up.
And then we go to that next value which is going to be 9.
So we'll go 7 to 9.
So this is on the right subtree and then from 9 would go down to 8 and then to 10 and that's it.
So this is how you traverse a tree using the pre order method when you're traversing a binary search
tree.
In the next video we're going to go over what's called the Post order traversal.
So see you in that video.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.