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
Welcome, ladies and gentlemen, to another very, very interesting exercise in our recursion section.
So in this video, what we are going to do is basically to write some function.
OK, this is basically these function will have to be implemented using some recursive concept.
And all these function will have to do is just to calculate the number of appearances of a given character
in a sequence.
And you are going to read a sequence of different characters and you don't know in advance how many
characters will be in this particular sequence, because that's something that we want to give the user
to decide.
So basically saying the user will insert different characters, OK, up until he inserts these character
of dollar in, once the user inserts the last character, which will be probably our stopping condition,
once the user does that, then we are going to return the number of appearances, the number of occurrences
of a given character that these function is going to receive and the function is going to calculate
and to return.
Finally, what is the number of times that these given character has occurred in the sequence that the
user has inserted?
So, for example, let's take a look at these examples.
So example.
So here we can see that a given character see OK is passed to the function and then the user specifies
these little nice sequence of A, B, C, A, C and A dollar, and then the function in a recursive
manner will simply return to since we have here two characters which are a C, OK, and that's the character
we are comparing with.
Awesome.
So I hope that the instructions are clear to you and you understand why do you have to do and now basically
take a few minutes and try to think of the solution, try to come up with a good idea, with a good
with a good strategy to how you can solve it.
I think we've already done some similar exercises that may come handy here.
So take your time, try to think of the solution in once you're done.
Let's proceed with our solution.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.