All language subtitles for 14. Finding Minimum Value in a Sequence of Elements

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

So what is going on, guys?

And welcome back to another very interesting video in our programming course.

And in the previous video, we started to talk and we also did some example regarding a recursive function

that all it had to do is just to get some natural number, which was knowm in this case to read a sequence

of numbers from the user.

OK, so basically a sequence of NUM numbers and then the function should return the maximum value in

this sequence.

And as we said previously, this can be done simply by using some for a loop and that's it.

But we need it and we solved it using the recursive approach by writing a recursive function.

And in this video, what we are going to do is simply to modify a little bit this question, and instead

of returning the maximum value, we will return the minimum value.

All right.

So that's not a big deal.

But still, I want to like to go over this exercise together.

So I've left also that template of the solution of the previous solution.

And we are just going to modify a couple of things and to make sure that we understand once again the

whole concept and the whole process of solving this exercise using recursion functions.

So with that being said, let's start working.

OK, so basically let's just modify the previous.

So so if we have this example of equal to equals to three and we have this sequence of one, three,

two in this example.

So now basically defined main function should return the value of one because that's the most the minimum

value in this sequence.

So let's first of all modify these find marks to be find mean and we will have also int num and now

we will simply also modify the variables names so minimal so far and the user input, user input is

going to remain the same in what we are going to do is just also modify it here.

So minimum so far, find minimum for now, minus one in minimum so far and know basically about that.

I want to talk to you guys.

OK, so.

OK, what do we want to do?

Basically, we want to write this function to be.

To have some some general structure, that's all it will be able to do is to find the minimum for a

given sequence of numbers that it's going to read from the user.

So if we have three numbers, these find mean for the value of three will be able to find the minimum

value in a sequence of three numbers.

Then in a recursive call, we are going to call these function again, find meaning with the value of

two.

And then we will assume that the function find men will be able to find the minimum value between the

two.

And as we said also previously.

Again, that's very important for you to maybe to write it down, I don't know, make some note or whatever

guys you're working with.

Basically, the base case is for this function find mean for economic woes to one.

That means that we want to find the minimum, OK, when we have a sequence of just one number and that's

the base case using these recursion function.

And if we know that we if we have just one number, then definitely this number in this sequence, which

is the user input, that's definitely the number that is going to be returned.

OK.

Awesome.

So that's also something that I wanted to say in the previous video, but I decided that I will edit

in this one.

So the approach was like this.

We are making some function.

If we are talking about the previous video, we had like find marks for a given name.

So basically, if we will generalize the function or functionality it can get, the previous function

can get some number, OK, which will represent a sequence that this function will be able to return

the maximum value or like in this case, in our current exercise, it will be able to return the minimum

value.

All right.

Awesome.

So now.

What we have to do is basically to go with pretty much the same approach and ask the following question,

we are looking for the minimum.

So far, so minimal, so far equals to find minimum.

So far, that's not a problem.

That's something that we we've done also previously.

And now we are going just probably to add these conditions.

So if the user input is less than the minimum so far.

OK, so if that's the case, if the current input is less than the minimum so far received from the

user in this sequence, then in this case we will return the user input and otherwise we will return

the minimum so far.

OK, so that's basically it for what I wanted to show you for this exercise.

Let's maybe build and run it to see and to make sure that everything works pretty much as we expected.

So let's go and build and run it building run so into a number three.

So a will.

What happened, what happened up?

We didn't call the function, so let's just call the function.

What's its name find mean.

So find me and then we will specify the number which these cases num let's build and run it once again.

So enter number three, you now enter an input.

So we said what was it in this example.

One, two, three, two, so one, three and two.

And we expect that this function, using this recursive approach, recursive manner will return the

value of one since this value is the most at the minimum.

OK, awesome.

So presenter and then what happened?

Oh, nothing happened because we didn't read the result.

Sorry you guys basically let's do it like end resolved so resolved equals to find mean so let's build

and run it.

So build and run it into a number three, enter a number three, one, three and two.

And what happened at the end printed this video.

Is something OK because.

The minimum value equals to the problem when you take some some exercise and you want to like to modify

one thing into running to make sure that everything is understandable, but not going into all the details.

So a lot of times things get messed up.

So enter a number.

Hopefully this one will work.

So three, one, three and two and the minimum value equals to one.

So basically, this is it for these video guys.

I hope you like it.

I hope you found it very, very useful.

Make sure you can write this function on your own.

Keep on practicing.

And we are going to see each other in the next videos.

Until then, bye bye.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.