Skip to content

Instantly share code, notes, and snippets.

Avatar

Victor Quebec simurq

  • Baku, Azerbaijan
  • 20:33 (UTC +04:00)
View GitHub Profile
@simurq
simurq / locked_pairs.c
Last active February 10, 2021 19:56
Function locked_pairs() for CS50
View locked_pairs.c
// Lock pairs into the candidate graph in order, without creating cycles
void lock_pairs(void)
{
int i, j, row, win, los, cycle;
for (i = 0; i < pair_count; i++)
{
win = pairs[i].winner;
los = row = pairs[i].loser;
cycle = 0;