How to count the number of unique elements in an array using C. Source code: github.com/por.... Check out www.portfolioc... to build a portfolio that will impress employers!
Thank you Uzair, I'm really glad to hear these videos helped you during your C programming class... that's exactly why I love to make these videos! :-)
Yes, there's a few ways. :-) One quick optimization would be to 'break' in the inner-loop as soon as a match is found. Another optimization would work if we knew the range of ints... we could create an array of bools (one for each possible int) and set the index for an int to true if a match is found, then checking to see if a match is found is a matter of checking that index, making the problem O(n) complexity (but taking up more space too).
Great to have you back. I hope all is well.
Thank you, and yes all is well. :-)
Im just here literrally to write this comment because even if I didnt watch.. im sure that it is.. great work sir...
Thank you, I appreciate that! :-)
Your hard work will pay you one day ☺️
Thank you for the support, I appreciate it. 🙂
BEST C tutorial I have ever seen and I love your voice
Thank you so much, I'm really glad that you enjoyed it! 🙂
Good to see another video. Hope the baby 👶is sleeping as well as expected and Mom and Dad are getting a little bit of sleep too.
Thanks! Baby and mom are doing well, and dad tries to get as much sleep as he can. :-)
Amazing C programs. They help me a lot during my C programming class
Thank you Uzair, I'm really glad to hear these videos helped you during your C programming class... that's exactly why I love to make these videos! :-)
I Learned a lot from this Channel. Thank you very much.
You're very welcome Jerwin, I'm really glad that you've learned a lot from this channel. :-)
Thank you sir.
And I was expecting whole the time the block of commands to calculate the length, why it takes him so long to write it 😃
Nice work
Thank you! :-)
Nice job! It looks like n^2 complexity. Is it possible to make it more efficient?
Yes, there's a few ways. :-) One quick optimization would be to 'break' in the inner-loop as soon as a match is found. Another optimization would work if we knew the range of ints... we could create an array of bools (one for each possible int) and set the index for an int to true if a match is found, then checking to see if a match is found is a matter of checking that index, making the problem O(n) complexity (but taking up more space too).
anyone help me
if(!match_found) is if(match_found == false)
is it right ?
Ur back
Yep! :-) Hoping to get back to posting at least semi-regularly now.
Great