[2023] CS50 - (Week 3) Runoff Solution | Walkthrough & Guide for Beginners | By Anvea

preview_player
Показать описание
(This solution has been checked and verified for 2023.)

This is CS50. CS:50 Introduction to Computer Science is an entry-level course taught by David J. Malan. Languages that you will learn include C, Python, SQL and Javascript plus CSS and HTML.

In this video, I will walk you through the solution for Week 3 - Runoff.

TIMESTAMPS
00:00 - Introduction
02:03 - Understanding the Distribution Code
05:23 - Vote
08:07 - Tabulate
12:25 - Print Winner
14:15 - Find Min
16:52 - Is Tie
19:52 - Eliminate

DISCLAIMER
I've just started learning too so I am by no means an expert. However, I feel that as a beginner who have just learnt and understood the concepts, perhaps I could share with you the thought process and steps that worked for me too!

SOLUTIONS FOR CS50 PSETS

LIKE AND SUBSCRIBE
If you found this video helpful, do give a like and subscribe to be notified when I post more videos for subsequent problem sets.

ENROL NOW

GET IN TOUCH

#cs50 #cs50population #cs50harvard
Рекомендации по теме
Комментарии
Автор

💯👏 I spent HOURS (literally, all last night and all morning) trying a million different things and I was completely lost. I was unable to grasp a full understanding of how multi-dimensional arrays worked, or cross-referencing them/manipulating them with data structs for that matter, since there weren't many (or any?) examples used in the class. I kept trying to update the second index of the preferences array (the index, not the value it stores), thinking that was the purpose of the second index. Duh, now I realize it's nothing like that... it's more like one of those multiplication grids, zeroing in on some stored value by cross-referencing two indexes. I don't think that entire paragraph made any sense 😝

I was so unbelievably lost! My brain has been tied in a knot to the point that I couldn't figure out what was up and what was down. Again, somehow you simplify this stuff without even trying... and I think the CS50 course has a way of oversimplifying things, expecting us to figure new info out ourselves, or else the opposite will be true and we'll complicate things more than they need to be. I would probably do much better with in-person learning, but your videos are allowing me to bypass student loans and continue to reap the benefits of remote-learning as if I were actually in the class. You're like an A+ tutor, only remote, and assisting so many of us without directly talking with us. Thank you again!

I wish the lectures and shorts would dive deeper into explaining the fundamental aspects of the new information presented... I'm such a n00b with this stuff, it's pretty defeating.

whitneyschutten
Автор

I swear I feel hopeless when I just can't figure it out by myself. This is so hard. I thought this course was for beginners. Thank you for this explanation.

AdonayFloresLaMota
Автор

I think the CS50 problem sets are too hard. Like, I write programs (just to practice) using arrays, data structs and even more without many problems, but I really can't figure out how to write programs like this (runoff). Lots of information and new things that aren't shown in the lectures.
But I will not give up, thanks for your work Anvea!

trovador
Автор

Learning to program (in my case CS50, Week 3) you'll eventually hit the wall. You'll try to scale it (bravely), you'll try to go around it. Maybe you'll even try to dig under it. In my experience this is just the waste of time. Curiously enough, it rarely helps to try and study some more. If there is a problem you are expected to solve, and you are stuck, if you have come across an insurmountable hurdle; The Wall, you must go through.
I suggest you hit it as you are. Keep banging it. Head, fist, shoulder. Kick it, elbow it, just keep at it. Never give up. Fall asleep tired from it, wake up nauseated by a thought of having to do it all over again. Dream about it.
Bang, bang, stars floating before your eyes. Get used to it, get bored by the futility of it. Feel sorry for yourself, doubt your ability, gnash your teeth in rage, drown in embarrasment, and keep banging the wall.
Forget why you are still even doing it!
Get lost in the action of banging your head against the impossible, nasty, indifferent wall.
And then, one dreadful morning, ready to continue your desperate job, you'll find the wall has disappeared.
You'll solve the problem just like that. So easy, you'll feel ashamed to be proud.
You'll realize, there has never been any wall.
Later, maybe, that the wall was within you, the wall was you.
The expense of time, energy, the sleep lost banging the wall was the only possible way to find out.
And what is your reward? Why! The problem set in Week 4!

cookymonstr
Автор

I didn't even know where to begin on this pset I had to come straight here. (I would've quit during week 1 w/o these videos thank you Anvea) I have to watch and re-watch each section before I finally understand but would never have thought of the solutions myself :/ I'm worried I'm violating the academic honesty agreement doing it this way and more worried I'm not cut out for this :/ anyone else in a similar boat?

miaomar
Автор

Literally the best explanation in all of Youtube! Thanks a ton for simplifying this problem !

disappointedkermit
Автор

I love your teaching style. It's well explained before putting in the code. Thank you.

YadiAnyankah
Автор

Thanks for your video, week 3 done, heading to week 4:D

azxc
Автор

I was stuck for weeks cause I didn’t quite understand what I was supposed to do! But thanks to your video I was able to figure out most of the rest by myself. Thank you!

Techni_Log
Автор

Thank you very very much. Your videos are awesome! Like Whitney said, you are an A++ tutor.

RicardoFilho
Автор

Your videos are amazing! Please keep doing them for this class. It's really helping me take what I've learned and applying it, and then checking my work against yours so that I can see how someone else came up with the solution.

MikeyCorral
Автор

The candidate you want to add the vote to is the ith candidate in the list. So if our candidates are Alice, Bob, and Charlie, then Alice is i=0, Bob is i=1, and Charlie is i=2.

If I am the first voter, and I want to vote for Charlie as my number one preference, then we have to set my preference for number one as Charlie, which we do by saying:

preferences[0][0] = 2

The first number in square brackets is zero because I am the first voter; the second number is also zero because I am voting my number one rank; it is equal to two because Charlie is the third candidate

Hope this helps!

rafaykhattak
Автор

Thanks for showing kindness to us beginners❤

ahsanulhaque
Автор

OMG literally bless you!!!! you have no idea how i struggled in this i had to skip it but it kept bugging me finding this was just amazing thank you so much!!!

d_e
Автор

thanks for uploading this, I havent solved the previous problem yet so i'll watch this one later 😺

introvertsenpai
Автор

Thank you so much. I love your style of teaching.
Very gentle and precise

artaround
Автор

I was completely lost in this spent two weeks for this ONE week....THANK YOU SO MUCH

drowse
Автор

Thank you very much ! I watch your videos when I'm stuck on something and most of the time I need only your explanations to get unstuck ! So thak you again for your work and time, this is useful !

BouilleBayBee
Автор

Thank you so much for posting these videos! They help me so much. CS50 is frickin HARD! :)

dmstevo
Автор

Thank you very much teacher! With your explanation I was able to understand. 🥰

SuperJumper