Skip to content

Instantly share code, notes, and snippets.

View odysseus0's full-sized avatar
🎯
Focusing

George Zhang odysseus0

🎯
Focusing
View GitHub Profile
@odysseus0
odysseus0 / classical_binary_search.py
Created August 8, 2022 12:17
[Binary Search] Classical Binary Search #python #algo
def binarySearch(array, target):
"""
input: int[] array, int target
return: int
"""
l = 0
r = len(array)
while l < r:
m = l + (r - l) // 2
if array[m] == target:
@odysseus0
odysseus0 / size_all.sh
Last active August 8, 2022 09:43
[size all] List all folders and files' size in descending human-readable format #shell
du -sh * | sort -rh