If you enjoyed the video and what I am doing on this channel, consider buying me a warm cup of coffee ☕❤️ www.paypal.com/donate?hosted_button_id=R8EXVLT5HFBYE
thank you this is hard for someone who has never coded before its very time. however, when you explain everything makes more sense when you explain. thank you
After watching the highest viewed videos @8:29 this guy is literally the only person on youtube that i watched who explained this section as if you were a student and didn't assume you know every single detail and process. well done and god bless you, i am now subscribed!!!
I really love the way you explain your logic, and then don't assume it is obvious. I like how you hope we were able to follow along instead. You seem like a genuinely nice guy. Thanks, Bogdan.
honestly!!! best explanation i've seen. ppl explain things on youtube and assume you know everything, dude if i knew everything why would i need an explanation?
Amazing! :) The video's are perfect to learn from, when I have done the assignments myself. I always learn new things from your video's! Great content!
Hello everybody, just for future references: While making the cs50 Algorithms problem set, the system showed me an error. This is because the tabulate function is not completely right. I changed the i < candidate_count into j < candidate_count. Then everything worked just fine.
this was really helpful to understand. I tried to solve it by myself and then compared it with your solution. The review of the whole solution explaining how all parts connected to each other helped a lot. Thank you so much, man. You definitely deserve some coffee tips and you'll get them soon :). Pls, keep posting the problem videos.
Bogdan, thank you for the video! It's very helpful unravelling this problem. For me personally it was a little fast to keep up. It would help if you type out all code instead of copy paste loop lines to create moren time to follow along, and if you'd take more time to scroll up and down when going from functions at bottom to main part of the code to explain what's happening. I hope my feedback is useful to you. Keep it up!
I have a question for the find_min function. You returned the value of least_votes outside the closed curly braces. Why not put it right after least_votes = candidates[i].votes < least_votes. by you putting it outside wouldn't that mean that the function would only return the voter_count if the condition (!candidates[i].eliminated && candidates[i].votes < least_votes) is not met?
Hey there, that's a good point, thank you, however only updating least_votes in the check allows us to keep iterating until we find the least existing number of votes, and stop only then, instead of returning on the first hit. We initialize it with the max possible number of votes and keep deducting, and the if check would always hit. Pretty sure it's not the best way to do it however, please feel free to play with it and point out any refactoring you'd see fit, cheers.
as usual your uploads are helpful. could you help me with preferences array? I am completly confused about it, how it is managing to store the voters and ranks. that is when used in bool vote function. Thanks :-)
The main thing it does is help us identify and match by name, the candidate passed as the argument, in the candidates array, and get the index. We loop through the candidates array, and once there's a match on the name, we further use that index. With that index, we use the other two arguments which help us navigate the matrix, we go to the position they indicate (voter = row & rank = column), and we store that index from above there to populate the matrix, and so on for each vote. Hope this helps a bit
What I find really useful for me, is just slowly going through the code and each iteration in my mind or on paper, pass some values and go through the flow to see what the code does, or in reverse what I would need it to do
I have a question. In the tabulate function, line 152, wouldn't that operator '!' make the condition true since candidates[i].eliminated was set to false at the start of the code (line 56)? Any help in understanding this would be greatly appreciated. Thanks. :)
If you enjoyed the video and what I am doing on this channel, consider buying me a warm cup of coffee ☕❤️
www.paypal.com/donate?hosted_button_id=R8EXVLT5HFBYE
thank you this is hard for someone who has never coded before its very time. however, when you explain everything makes more sense when you explain. thank you
Cheers Ernesto
After watching the highest viewed videos @8:29 this guy is literally the only person on youtube that i watched who explained this section as if you were a student and didn't assume you know every single detail and process. well done and god bless you, i am now subscribed!!!
I really love the way you explain your logic, and then don't assume it is obvious. I like how you hope we were able to follow along instead. You seem like a genuinely nice guy. Thanks, Bogdan.
honestly!!! best explanation i've seen. ppl explain things on youtube and assume you know everything, dude if i knew everything why would i need an explanation?
this was so helpful. you actually explained it well unlike the other coders. thanks.
Cheers Arjun, glad it helped
Amazing! :) The video's are perfect to learn from, when I have done the assignments myself. I always learn new things from your video's! Great content!
Thanks so much, Kasper
concise and clear; thanks man!
Cheers
Hello everybody, just for future references: While making the cs50 Algorithms problem set, the system showed me an error. This is because the tabulate function is not completely right. I changed the i < candidate_count into j < candidate_count. Then everything worked just fine.
The way I did it was way more complicated. Thanks for showing a more clear version.
Cheers!
Sir, you explained it perfectly. It was very easy to understand. Thanks 😊
Glad to hear that
this was really helpful to understand. I tried to solve it by myself and then compared it with your solution. The review of the whole solution explaining how all parts connected to each other helped a lot. Thank you so much, man. You definitely deserve some coffee tips and you'll get them soon :). Pls, keep posting the problem videos.
Thanks, Lan, glad to know
Bogdan, thank you for the video! It's very helpful unravelling this problem. For me personally it was a little fast to keep up. It would help if you type out all code instead of copy paste loop lines to create moren time to follow along, and if you'd take more time to scroll up and down when going from functions at bottom to main part of the code to explain what's happening. I hope my feedback is useful to you. Keep it up!
Hi, sure, this is valuable to me, thank you for the feedback
at 11:51 on your screen we can see that {for (int j=0; i < candidate_count; j++)} instead of {for (int j=0; j < candidate_count; j++)}
Thank you, Dara, great catch, I've corrected that in the code on Github
BogdanBudaca great!
I was wondering why you equates least votes to voter count also, swing as the voter count is a fixed number, and doesn’t relate to the minimum votes
also how come you used least votes as your integer and not just min?
That is just what I initialize it to and then changing it to the lowest number as we loop
I have a question for the find_min function. You returned the value of least_votes outside the closed curly braces. Why not put it right after least_votes = candidates[i].votes < least_votes. by you putting it outside wouldn't that mean that the function would only return the voter_count if the condition (!candidates[i].eliminated && candidates[i].votes < least_votes) is not met?
Hey there, that's a good point, thank you, however only updating least_votes in the check allows us to keep iterating until we find the least existing number of votes, and stop only then, instead of returning on the first hit. We initialize it with the max possible number of votes and keep deducting, and the if check would always hit.
Pretty sure it's not the best way to do it however, please feel free to play with it and point out any refactoring you'd see fit, cheers.
as usual your uploads are helpful. could you help me with preferences array? I am completly confused about it, how it is managing to store the voters and ranks. that is when used in bool vote function. Thanks :-)
The main thing it does is help us identify and match by name, the candidate passed as the argument, in the candidates array, and get the index. We loop through the candidates array, and once there's a match on the name, we further use that index.
With that index, we use the other two arguments which help us navigate the matrix, we go to the position they indicate (voter = row & rank = column), and we store that index from above there to populate the matrix, and so on for each vote.
Hope this helps a bit
@@BogdanBudaca Thanks. somewhat I am getting the idea of the array.
What I find really useful for me, is just slowly going through the code and each iteration in my mind or on paper, pass some values and go through the flow to see what the code does, or in reverse what I would need it to do
@@BogdanBudaca very practical approach. will practice the same. Thanks :-)
hi, i had a question. Whats's the use of char name[50]? what does it do
Hi Maria, that is a char array, used this one to store a name. (C doesn't have the string datatype)
@@BogdanBudaca thank you
I have a question. In the tabulate function, line 152, wouldn't that operator '!' make the condition true since candidates[i].eliminated was set to false at the start of the code (line 56)? Any help in understanding this would be greatly appreciated. Thanks. :)
Think the eliminate() function and line 120 in the while loop take care of updating that, they just all start as 'not eliminated'
Great work! Thank you!
Glad you liked it
Alice is index 1 in the argument vector, since the ./runoff would be index 0
Hi, yes that's correct, thank you
amazing video
Thank you so much
thank you 🥰
Thank you!
Glad you liked it
We need tidemen method of voting in the next video in c language 😀
Hey when will you post tideman
Hi Mihir, I had a bit of vacation and I'm still working on tideman, hope to have that soon
How much more time for tideman🤔🤔😢