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
OK, so let's take a look at what should be done in the solution.
Basically, once we implement just the part of rotating by one to the right, then I think it shouldn't
be much of a problem to make the rotations right by end positions, which should be pretty much the
same.
So we will leave the outer loop as is.
We will use temp equal to want.
What do we know?
What do we want to take into account?
So first of all, let's start and understand basically the main steps for implementing rotate by one.
So we want all of them to move by one element to the right.
OK.
That's what we want to do using some for a loop.
Probably, right?
But we don't need and we don't want these value the right most value to be.
To be basically deleted with the value of seven when we rotate to the right because we did not use it
right here yet.
So what we will create, we will create a temp variable.
And now these temp variable will be for inserting these for a loop.
We will put it a value of three or basically the final element in the value series or values a at index
size minus one.
OK, that's what we'll go to temp and then we will use a for a loop, for a loop that should start from
where if we will start the for a loop from equal to one, as long as is less than size and do something
very similar, then it may be kind of a problem because if we put five here, then on the next iteration
we lost the four.
So we should start maybe from another way, another option because we do not want to lose track of any
value.
We may start with the value of size minus one, right?
Start from this value right here and we will do that as long as I is greater than zero or one will see
right away.
And basically, we will say that every time that, first of all, we will put here the value of the
element on its left.
So we will place here at 7:00, then we will move to this one, we will place here for the valley on
its left.
We will place here five when equal to one.
And when I pull to zero, we will not do anything, so we'll basically stop.
So as long as I is greater than zero, then we are going to do this operation.
And finally, after words, we will put the value in sitemap to the left most element.
And we will get here at 3:00.
So is there anything clear if you have any questions, feel free to ask them in the U.S. and we will
gladly answer them.
So let's try to figure out now what we should change and what we should modify.
So this part of the explanation is one of the most important parts that you need to be familiar with
in order to basically to know how to approach this exercise.
So what we will do is we will say temp will be equal.
OK?
This part refers to rotating by one to the right.
OK, given away so it will be equal to value, zero are at index size minus one the right most element.
And then we will start from i.e. equal to what equal to size minus one.
That's the index of the right most element.
As long as I is greater than what then zero, but not included I minus minus.
OK.
That's what we are going to do.
And on every iteration, what we want to do is to take the value of the previous, the value on of the
element on the left and to put it inside here.
Okay, so what what did we have previously?
Let me get it back.
What did we have previously?
We had like five four, seven three.
So we want seven here.
So what we will do is, come on, what happened?
Yeah.
Okay, so we will see the value in this specific index right now should be equal to the value on what?
On my left.
OK.
And that kind of ensures also I'm minus one, you know, that the the largest index is equal to one.
So you will not basically.
Go out of bounds.
So once you are done with it, all you will have is this array.
Like that?
OK, so you will have
five.
Four seven.
And also here will be five in the final step, which is this one will be used for what the reporting
values the error at index zero.
OK.
With the value inside of variable temp.
So the final result should be like this.
Three five four seven.
That's the rotation by one to their right.
That's all that happened.
And now once once we close it using this outer loop.
We do this operation over and over how many times and times that's what we do.
Is it clear that's it?
Thank you for watching and enjoy.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.