Skip to content

Instantly share code, notes, and snippets.

View engkimbs's full-sized avatar

Daniel kim engkimbs

  • Republic of korea
View GitHub Profile
@engkimbs
engkimbs / P2Q.py
Created December 16, 2016 17:49 — forked from giantonia/P2Q.py
# python3
def parent_key_cal(key):
if key % 2 == 0:
parent_key = (key - 2)//2
else:
parent_key = (key - 1)//2
return parent_key