very enjoyable to watch and learn at the same time. I would like to see if at the end of each lesson you throw an exercise with additional complexity for practice and get more interaction with your followers(Learners like me). thank you
Hi, great video! I've learned a lot from these exercise videos and i understand the logic as well. After each video, i try to create these codes on my own and it's been a great learning experience. Thankyou for sharing this information!! Quick question though: once I'm done with this exercise playlist, how do I progress further? Do these exercise questions get asked in Interviews? And could you share an example of these exercises are used in real life projects or applications? Thanks in advance:)
I would suggest progressing further by working on your own "side projects". Try to build something you're interested in building, for example a game, or some utility tool. There are lists of "project ideas" online. In the process of building a project you'll find that you'll need to self-learn other topics, but that's an incredibly useful process that's similar to working on "real-world commercial projects" where you'll need to do the same. Some of these exercises likely get asked in interviews, yes. Regarding real-world applications, in the case of some exercises there are many, and in others there are not many at all. :-) So something like Fizz Buzz is based off a children's game and is helpful in terms of teaching us how to think through a simple problem. Other exercises like say Quicksort are used all the time as part of standard libraries to sort anything from a list of files to a playlist, etc.
Great video. I have a question. How do you find the number of all repeated values in an array which size is given by the user and the numbers are random numbers? Example n=10, a[n]={1,1,2,2,3,3,3,4,4,4} and i need it to print the number of occurrences of every number in the array. Thank you!
Each time u find an occurrence u will have to update the array, and this process could be a pain in C , kind off , I'm not sure , I' don't wanna give this one a shot right now , but if u insist I can sacrifice my time to solve this one ;
Great question Zhenghao! :-) There are a number of ways you could do this. One way would be to have 10 variables, one for each number, to keep a count of each number. You could then have inside the loop that loops through the array an if control structure like this: if (array[i] == 0) zero_counter++; else if (array[i] == 1) one_counter++; ... and so on ... You could use a switch here instead. You could also use an array to keep track of the counts using an array. So something like: int counts[10]; where counts[0] keeps track of the count of occurrences of 0, counts[1] keeps track of the count of occurrences of 1, and so far. Those are just some ideas though. This video on counting each letter in a string might give you some ideas too: ua-cam.com/video/1OZMcC0euic/v-deo.html. :-)
@@boborafg5632 That would probably be something like this: if (arrray[i] > 7) return array[i]; or possibly return i; instead if you are looking for the index of that element.
Well if you want the first value higher than 7, you either need to store that value in an array or return the value from a function, or stop the loop when it finds the value, or *something* like that. Exactly what you do is up to you, but that if-statement there is the general idea. :-)
Nice Serie , Thanks :
int Occurences (int *array,int length,int to_find){
int count = 0;
for(int i = 0 ; i < length ; i++){
if(array[i] == to_find){
++count;
}
}
return count;
}
very enjoyable to watch and learn at the same time. I would like to see if at the end of each lesson you throw an exercise with additional complexity for practice and get more interaction with your followers(Learners like me). thank you
I'm glad you enjoyed it! :-) Thanks for the suggestion, maybe one day I'll do something like that.
These are great little exercises, but I find myself having to constantly pause to keep up with your speed
Hi, great video!
I've learned a lot from these exercise videos and i understand the logic as well. After each video, i try to create these codes on my own and it's been a great learning experience. Thankyou for sharing this information!!
Quick question though: once I'm done with this exercise playlist, how do I progress further?
Do these exercise questions get asked in Interviews?
And could you share an example of these exercises are used in real life projects or applications?
Thanks in advance:)
I would suggest progressing further by working on your own "side projects". Try to build something you're interested in building, for example a game, or some utility tool. There are lists of "project ideas" online. In the process of building a project you'll find that you'll need to self-learn other topics, but that's an incredibly useful process that's similar to working on "real-world commercial projects" where you'll need to do the same.
Some of these exercises likely get asked in interviews, yes.
Regarding real-world applications, in the case of some exercises there are many, and in others there are not many at all. :-) So something like Fizz Buzz is based off a children's game and is helpful in terms of teaching us how to think through a simple problem. Other exercises like say Quicksort are used all the time as part of standard libraries to sort anything from a list of files to a playlist, etc.
Great video. I have a question. How do you find the number of all repeated values in an array which size is given by the user and the numbers are random numbers? Example n=10, a[n]={1,1,2,2,3,3,3,4,4,4} and i need it to print the number of occurrences of every number in the array. Thank you!
u have to hash in this case
Each time u find an occurrence u will have to update the array, and this process could be a pain in C , kind off , I'm not sure , I' don't wanna give this one a shot right now , but if u insist I can sacrifice my time to solve this one ;
please do it for us😅@@justcurious1940
What if we wanted the program to print which numbers were repeated without us typing the numbers
How can i count all the numbers: 0~9; make the output like : 0s found 0; 1s found 1; 2s found 1; 3s found 0....... 9s found
Great question Zhenghao! :-) There are a number of ways you could do this. One way would be to have 10 variables, one for each number, to keep a count of each number. You could then have inside the loop that loops through the array an if control structure like this:
if (array[i] == 0) zero_counter++;
else if (array[i] == 1) one_counter++;
...
and so on
...
You could use a switch here instead. You could also use an array to keep track of the counts using an array. So something like:
int counts[10];
where counts[0] keeps track of the count of occurrences of 0, counts[1] keeps track of the count of occurrences of 1, and so far.
Those are just some ideas though. This video on counting each letter in a string might give you some ideas too: ua-cam.com/video/1OZMcC0euic/v-deo.html. :-)
How can i count the values between 5 and 8 ( example)?
Great question! :-) We could have the if-statement look something like this:
if (array[i] >= 5 && array[i]
@@PortfolioCourses thanks, but do u also know how i can get the first occurrence higher than 7 in a array.
@@boborafg5632 That would probably be something like this:
if (arrray[i] > 7) return array[i];
or possibly return i; instead if you are looking for the index of that element.
@@PortfolioCourses yes but then i get all values higher than 7
. I want the first value higher than 7
Well if you want the first value higher than 7, you either need to store that value in an array or return the value from a function, or stop the loop when it finds the value, or *something* like that. Exactly what you do is up to you, but that if-statement there is the general idea. :-)
It's called Frequency Counting.
How to find items are less than 100 for example and print “ there 5 items less than 100 “
sir please say how to find all elements counts please sir🙏🙏🙏.