Cs50 Tideman Solution Info
Once the graph is locked, the winner is the candidate with no incoming edges (the source of the graph).
The winner is the candidate with (i.e., no locked[j][i] true for any j ). Loop through each candidate, and if none of the other candidates have a locked edge pointing to them, that candidate wins. Cs50 Tideman Solution
I realized I needed a recursive function. The prompt asks: Does locking this pair create a cycle? Once the graph is locked, the winner is
int main() // Get the number of candidates and voters int num_candidates, num_voters; printf("Enter the number of candidates: "); scanf("%d", &num_candidates); printf("Enter the number of voters: "); scanf("%d", &num_voters); Once the graph is locked