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
@kasperjeppesen49074 жыл бұрын
Amazing! :) It really helped understand quite alot of the problem. Thank you for your awesome videos!
@BogdanBudaca4 жыл бұрын
Really glad to hear, thank you, cheers
@green-coder4 жыл бұрын
hello sir "check50" reported an error with "sort_pairs", the rest were all green! how i fix this error please thanks
@josephsozio73164 жыл бұрын
Thanks for the help on this one! Recursion really melts my brain :) Quick question - I noticed this function prototype used v as a variable name for the int parameter but in the implementation you used i bool check_cycle_util(int v, bool visited[]); vs. bool check_cycle_util(int i, bool visited[]){} Looks like it still compiled fine for both you and me. I am still learning C, do you know why this compiles without complaining about the above mismatch?
@BogdanBudaca4 жыл бұрын
Hi Joseph, same for me, it will get easier with further iterations :) Good catch, cheers, didn't even notice, turns out the declaration and implementation can have different argument names, just need same order and data types, found this stackoverflow.com/questions/39224689/different-parameter-name-in-function-prototype
@waltertaju4 жыл бұрын
Great help Bogdan! But the "check50" reported an error with "sort_pairs", the rest were all green! Did you have the same issue? Suggestion: upgrade the mic, I missed some of the words you said. Thanks a ton!
@BogdanBudaca4 жыл бұрын
Thanks Walter, cheers. Hmh, it worked for me in the end. Sorry about the audio, had my AC on cause it was super hot and my mic was fighting the background noise, with my voice as collateral.
@waltertaju4 жыл бұрын
@@BogdanBudaca Alright. Will keep debugging my code.
@green-coder4 жыл бұрын
@@waltertaju how do you fix this error please ?
@emmafrankly4 жыл бұрын
So on the actual ballot for the voters, it's just simple ranked voting? "Rank the candidates by preference," with mandatory ranking (i.e., have to choice a first choice, a second choice, and a third choice in a 3-candidate instance)?
@BogdanBudaca4 жыл бұрын
Yup, that's right
@emmafrankly4 жыл бұрын
@@BogdanBudaca Great, thank you!
@mihirpatel99414 жыл бұрын
Thanks man loved it
@BogdanBudaca4 жыл бұрын
Cheers Mihir
@MKSundaram3 жыл бұрын
I am getting one frown face that is for print_winner prints of election when some pairs are tied print_winner did not print winner of election. could yoi please help me?
@BogdanBudaca3 жыл бұрын
Oh the code on Github might help get a hint if you want to check it out
@MKSundaram3 жыл бұрын
@@BogdanBudaca - Thanks. God bless you :-)
@MKSundaram3 жыл бұрын
I found that my print statement was inside the if(locked) block and that's why the error. I placed it after the inner loop and inside the outer loop. It worked. Thanks. :-)
@BogdanBudaca3 жыл бұрын
Oh great, glad to hear you spotted the issue
@MKSundaram4 жыл бұрын
I'm confused about the rank variable. I'm not able to trace the source of input to int rank. From where does it take its argument?
@MKSundaram4 жыл бұрын
Finally, I traced the source of rank, it is variable 'j'. Now I don't understand preferences array. How it gets populated and how does the increment operator helping in populating the array.
@BogdanBudaca4 жыл бұрын
Hey there, we look at the ranks array and compare candidates two by two; the candidate at index 0 for example beats candidate at index 1, being the first choice. With this info we go into the preferences matrix and update it at index [ranks[0]][ranks[1]], thus marking +1 for the preferred candidate over the less preferred one.
@MKSundaram4 жыл бұрын
@@BogdanBudaca Oh! That was so simple, how did I missed that. Thanks.
@BogdanBudaca4 жыл бұрын
Glad it helped
@stantonreddy62766 ай бұрын
@BogdanBudaca i appreciate yr videos, but what set u aside from the others, is the way you explain things, unfortunately in this video, the audio is bad, yes i can see the code, but its missing yr explanation which is the most important part😞
@organizedchaos45594 жыл бұрын
I usually really like your videos for these problems as you do a really good job on explaining it but I think for this one you leave me more confused.
@BogdanBudaca4 жыл бұрын
Yup, not really happy about the audio, was hoping the explaining that was audible and the code would help a bit more
@steveyee57754 жыл бұрын
Wish this was watchable man but the sound is more painful and frustrating that tideman itself
@BogdanBudaca4 жыл бұрын
Oh yup, agreed, might look at a redo soon, but hope the code helps
@_Silviu Жыл бұрын
Plâng de 2 zile la problema asta😂 Sper că e cea mai grea de la CS50, fiindca altfel îl termin la anul😜 Dacă nu reușesc pana la finalul săptămânii, revin😁
@BogdanBudaca Жыл бұрын
Da, a fost f dificila si pt mine, inca ma bantuie 😆
@vladh25573 жыл бұрын
Bogdan thanks for the video, but please do something with the sound. A lot of the time it breaks up
@BogdanBudaca3 жыл бұрын
Yup I know, sorry about that, didn't get to re-shoot this one yet, hope the code helps though
@soulcrystals4 жыл бұрын
Thanks for the effort and the good intention but with this sound I just cannot watch a video for 52min... information gets lost while i am focusing on what you say but I miss bits of it.
@BogdanBudaca4 жыл бұрын
Hey there, yup, it's pretty bad, been thinking about having another go at it but I'm a little caught up for a few weeks, I hope that at least the code helps some
@DigitalDivotGolf3 жыл бұрын
If you were to make another video and voice over this one you could explain with good quality sound but this is unlearnable. Thanks for the video but it’s more of a distraction trying to guess/understand what you said than it’s worth watching.
@Venezuelangel4 жыл бұрын
sound is terrible
@BogdanBudaca4 жыл бұрын
Yup, sorry about that, it was hot and had the AC on, the mic kept cutting my voice along with the background noise