Skip to content

Instantly share code, notes, and snippets.

View A7med-Ma9dy's full-sized avatar

Ahmed Magdy A7med-Ma9dy

View GitHub Profile
@A7med-Ma9dy
A7med-Ma9dy / cs50_Tideman_cycle-explanation.md
Created January 17, 2022 18:08 — forked from nicknapoli82/cs50_Tideman_cycle-explanation.md
My attempt at clarifying how cycles work for the Tideman algorithm

A Way to Look at Tideman Lock Pairs

I've observed that there is a little bit of a disconnect in understanding what it is that needs to be done to properly implement the lock_pairs function for cs50 Tideman. The goal of this little write-up is simply an attempt at explaining what the problem actually is, and why a cycle imposes a problem.

First:
If you are unfamiliar with the actual problem, or have not read through the entire cs50 Tideman problem description. Then I think you should start there.
cs50 Tideman

Second:
This little write-up is only narrowing in on the idea of cycles, and a way to think about what a cycle is and determine if locking a pair in the pairs array would create that cycle. This does not talk about any other part of the Tideman problem.