Afrikaans
Akan
Albanian
Amharic
Arabic
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
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
What is going on, guys?
And thank you so much for getting this far.
You're doing a great job and I can guess that you will, if not already, see meaningful results in
this story.
All I want to talk about a situation where we have these two variables, A and B, and each of these
variables has some value within.
All right.
And for some reason, we have to swap between these two values.
So, for example, at the beginning, we have some box A with a value of ten and a box B with a value
of twenty.
And what we need to do is just to exchange the values within these boxes.
So we at first we had a value of 10 in box A and a value of 20 in box B.
Then after the exchange, there will be a value of 20 in Box A and the value of Tamlin Box B, just
as we can see it in these demonstration.
And basically, you can think of this situation of swapping between the values, the content of two
different boxes as just two boxes with this, some pairs of shoes.
One box has Manchus and the other box has woman's shoes.
So, for example, in box A, we have 10 man shoes, and in box B, we have 20 woman shoes.
But it turns out that box say that should contain woman shoes, basically contains men's shoes.
And that's why we need to replace all the shoes from box, say, with all the shoes from Box B..
Right.
So what would be the trivial way they are to you would solve these kind of task?
You can't just simply take and pour what is in one boxing through the second box and vice versa simultaneously.
Because in this case, there will be just a mix of all the shoes in every box.
And that's not what we want.
What we want is probably to get another box and call these box temp and these box will be used to assist
in these six changing process.
So first of all, we'll take the value of box A, which is 10 and just put it inside of box temp venerable,
take the value of 20, all the shoes from Box B and put them inside of box A.
And finally, we will take all the shoes, all the value itself of 10 from box temp and put these value
inside of box B.
And now the exchange and process between these two boxes, A and B, we can say that it's complete.
So basically you can see that the value of ten, which was previously in box A, is now at Box B and
the value of twenty, which was at box B, is now at box A four.
All right.
Very well, guys.
That's was kind of rough explanation using a real life situation.
And now what I want us to do is to be more close to the programming world.
I want us to write a simple code, a simple program that will use these swap thing in our programming
language so that you will be able to take your skills even one step further.
So I hope this topic is clear for you and that you are ready to move onto the next video for a swap
in your programming language.
I'll see you there.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.