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
So additional question in our programming course regarding linked lists, I hope you are on right so
far.
So this question is very similar to you exercise the previous exercise.
So we will go over it really quickly.
So what do we have to do is to write a function that receives a linked receives a linked list and some
integer number, OK?
And all the function should do is simply to return the number.
OK, let's modify this part.
Return the number.
OK, the number of occurrences of these events number in the list.
OK, so we receive a linked list and we receive a number and we eat to rate over all the nodes of these
linked list and then we count how many times.
And we we we've even if we have encountered in the nodes that have these integer number.
OK, so let's start writing down the function.
And what we can say is that the function is going to be probably of an integer type.
Right, because we use it to count something to count the number of nodes having these number.
OK, and it's very simple.
So ain't, let's say, total total number appearances, appearances, even say it in list.
OK, so these function will receive the header and also it will receive a number.
So it no num no.
You know, what we are going to do here is to create a count variable just like previously in council
or in count equals to zero node pointer current and let's say tampoe equals to had.
You know what we are going to do is as long as we haven't reached the end of the linked list, meaning
we haven't reached the last node.
So while Tambe next does not equals two does not equal to null.
So as long as that's the case, we will check if temp data equals to.
And if that's the case, we will simply use count plus plus meaning we found a node that has as its
in its data field, a num num value.
So found a corresponding corresponding node, ok.
And of course in both cases if we found or if we didn't find, then we should simply move temp to the
next node.
So temp equals to temp next.
And there you go.
That's how you iterate over all the nodes of this linked list and you count how many times you found
a corresponding node with a data field equals to NUM, which is this guy over here.
And lastly, you simply return the count and that's how you do it.
Guys, that's how you do it.
That's how you tackle different linked list problems.
That's how you work with pointers.
I hope they at this point, you're starting to feel more confident about how pointers can be used.
Of course, there are a lot of data structures that we may use for our practice, but for these section,
I think it will be enough.
And this is it for this video, guys.
As always, let me know what you think about it.
Feel free to to put some review, to write some comments and until next time, have a great day or evening,
whatever it is.
I'll see you then.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.