Skip to content

Instantly share code, notes, and snippets.

View sadi304's full-sized avatar
🕶️

Sadi Mahmud sadi304

🕶️
View GitHub Profile
@sadi304
sadi304 / detect.py
Created March 23, 2019 16:36
Detect cycle in a directed graph
#
# detect cycle
# in a directed graph
# sadi304
#
def dfs(G, u, color, found_cycle):
if found_cycle[0]:
return
color[u] = "gray"
@sadi304
sadi304 / conflict_serializable.py
Created April 14, 2019 17:08
Check whether a schedule is conflict serializable or not
# schedule
schedule = "r1(x) r1(y) w2(x) w1(x) r2(y)".split(' ')
final_schedule = {}
cycles = {}
i_index = 0
for i in schedule:

Keybase proof

I hereby claim:

  • I am sadi304 on github.
  • I am sadimahmud (https://keybase.io/sadimahmud) on keybase.
  • I have a public key ASA118g-3ugNX8KM8g6rd19lL9hnK_wuSU2kw7WDdqL7AQo

To claim this, I am signing this object: