Functionis_sum_subset >>> is_sum_subset([2, 4, 6, 8], 5) False >>> is_sum_subset([2, 4, 6, 8], 14) True
dynamic_programming/sum_of_subset.py:1
Functionkth_number Return the kth smallest number in lst. >>> kth_number([2, 1, 3, 4, 5], 3) 3 >>> kth_number([2, 1, 3, 4, 5], 1) 1 >>> kth_numb
divide_and_conquer/kth_order_statistic.py:26
Functionlongest_increasing_subsequence_length >>> longest_increasing_subsequence_length([2, 5, 3, 7, 11, 8, 10, 13, 6]) 6 >>> longest_increasing_subsequence_length([]) 0 >>> l
dynamic_programming/longest_increasing_subsequence_o_nlogn.py:20
Functionlongest_subsequence Some examples >>> longest_subsequence([10, 22, 9, 33, 21, 50, 41, 60, 80]) [10, 22, 33, 50, 60, 80] >>> longest_subsequence([4, 8, 7
dynamic_programming/longest_increasing_subsequence_iterative.py:21
Functionlongest_subsequence Some examples >>> longest_subsequence([10, 22, 9, 33, 21, 50, 41, 60, 80]) [10, 22, 33, 41, 60, 80] >>> longest_subsequence([4, 8, 7
dynamic_programming/longest_increasing_subsequence.py:19
Functionmae Examples(rounded for precision): >>> actual = [1,2,3];predict = [1,4,3] >>> float(np.around(mae(predict,actual),decimals = 2)) 0.67
machine_learning/scoring_functions.py:19
Functionmajority_vote >>> majority_vote([1, 2, 2, 3, 1, 3, 2], 3) [2] >>> majority_vote([1, 2, 2, 3, 1, 3, 2], 2) [] >>> majority_vote([1, 2, 2, 3, 1,
other/majority_vote_algorithm.py:11
Functionmanhattan_distance_one_liner Version with one liner >>> manhattan_distance_one_liner([1,1], [2,2]) 2.0 >>> manhattan_distance_one_liner([1.5,1.5], [2,2]) 1.0
maths/manhattan_distance.py:81
FunctionmergeReturn a sorted array. >>> merge([10,9,8,7,6,5,4,3,2,1]) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] >>> merge([1,2,3,4,5,6,7,8,9,10]) [1, 2, 3, 4
sorts/recursive_mergesort_array.py:8