Date: 4/27/2020
Scenario:
- I want to have a single Interface Class that has a Base Implementation Class with multiple instance implementations for other Inheriting Classes
def distance(u, v): | |
""" | |
Calculates Euclidean distance between two point | |
distance = square_root( sum(u_i - v_i)^2 ) | |
u: [float, float], point1 | |
v: [float, float], point2 | |
""" | |
sum_ = sum((u[i] - v[i]) ** 2 for i in range(len(u))) | |
return sum_ ** (1 / 2) |
# --- Code Book: Python Algorithms | |
# --- Source : github.com/keon/algorithms.git | |
#======================================================================================================================== | |
# :: tree/path_sum.py :: | |
#======================================================================================================================== | |
| 1| """ | |
| 2| Given a binary tree and a sum, determine if the tree has a root-to-leaf | |
| 3| path such that adding up all the values along the path equals the given sum. | |
| 4| |
#!/usr/bin/env python | |
""" | |
Usage: | |
$ git-file-size-growth <NUM_COMMIT> | |
note: | |
- Put `git-file-size-growth` somewhere in your PATH along with `git-file-size-diff` | |
# see `git-file-size-diff` at: http://stackoverflow.com/questions/10845051/git-show-total-file-size-difference-between-two-commits/10847242#10847242 | |
""" |