CS50 RUNOFF | PROBLEM SET 3 | SOLUTION

preview_player
Показать описание
In this video, I walkthrough how to complete runoff, a practice problem from week 3.

I went through in detail so that beginners will be able to understand how to attempt and solve this practice problem.

Like and subscribe if you enjoyed this video, if you have any questions comment down below.
Рекомендации по теме
Комментарии
Автор

You are my personal super hero... i have been stuck on this thing for 7 months (with a break of 6 months included haha)... You visualize what the code is doing, you rename variables so I can follow what they do, I finally understand the tabulate function ty

floralemmens
Автор

Thanks bro! I could not for the life of me figure out the tabulate function, you helped it make a lot more sense!

eljefe
Автор

It took me around a week to understand how the arrays were being used, along with the structure. I guess the hardest part was in the tabulate function, where we used the value of preferences[i][j] as the substituted value inside the candidates array. The syntax confused me for a second. You made it very clear. Thank you!

elfullin
Автор

You have no idea how satisfying it was to figure out the task with your help instead of doing it on my own. I didn't have to rack my brains so hard. Thanks a lot❤

ena.husejnefendic
Автор

I find it very helpfull, it always helps me to solve bugs and keep me motivated on studies.

gabrielrick
Автор

keep going bro and please continue to other pesets

HATE-X
Автор

My man sajid. Thanks for your videos bro. It was like working together with someone to check my answers. Sad that I don't see you uploading anymore while I'm moving in with week 4 hope all is well.

chrisgrad
Автор

Helped a lot, was stuck at the tabulate part for a while!

steel_hat_pirates
Автор

thank you so much! your explanation made it way easier to understand☺ i am a total beginner and your videos help me every time

Na-xjoq
Автор

Thank you, Sajid. I did a couple of functions a little bit differently and it was really useful to compare them with yours - I guess I'd made some things overcomplicated 😄

sheldonj
Автор

I was trying to find how others solved the problem and bumped into your channel. Love the way you did it and the way you explained how and why each and every line of code works. Although most of my code matches the way you did it, I think you'd be interested in how I did the tabulate function. Hope this helps :)

void tabulate(void)
{
for (int i = 0; i < voter_count; i++)
{
int j = 0;
while (candidates[preferences[ i ] [ j ] ].eliminated)
{
j++;
}
candidates[preferences[ i ] [ j ] ].votes += 1;
}
return;
}

zemrwrld
Автор

I was thinking what if the voter entered the same candidate on more than one rank, wouldn't it make our result go wrong?

Hitmonle
Автор

Thanks man, you explain very good. Helped me with 2/6 functions. Like.

Alexandr_Silver
Автор

Hey Sajid, thank you so much for you content!

gabrielrick
Автор

Hello, I have a cuestion, if we solve this code with your help, the acedemic honesy of cs50, we would be corrupting the rules?, because in my case the guide that you make helps me, because many times writing these types of codes is difficult.

timoschick
Автор

is the cs50x even worth all this effort ?

CJchan
Автор

Why is the votes are not minimum is not a a tie? Why should be the candidates vote equal to the minimum?

ingridjocelynab
Автор

I do not understand the tie function 😢

ingridjocelynab
Автор

Your explaination is very good, but how should i increase my logical thinking, as we all know that solving problems by watching their solutions didn't make us good programmer

sahilvermaH
Автор

I don't know why but it sounds like a cute singaporean accent behind~

shiuandai