↓ 1 callersFunctionidentity :param n: dimension for nxn matrix :type n: int :return: Identity matrix of shape [n, n] >>> identity(3) [[1, 0, 0], [0, 1, 0], [
matrix/matrix_operation.py:83
↓ 1 callersFunctioninorder
In-order traversal visits left subtree, root node, right subtree.
>>> list(inorder(make_tree()))
[4, 2, 5, 1, 3]
data_structures/binary_tree/binary_tree_traversals.py:59
↓ 1 callersFunctioninorder >>> inorder(make_tree()) [6, 10, 14, 15, 20, 25, 60]
data_structures/binary_tree/inorder_tree_traversal_2022.py:46
↓ 1 callersFunctioninsert_next Inserts the '(index-1)th' element into place >>> col = [3, 2, 4, 2] >>> insert_next(col, 1) >>> col [2, 3, 4, 2] >>> col =
sorts/recursive_insertion_sort.py:39
↓ 1 callersFunctioninsertion_sort >>> array = [4, 2, 6, 8, 1, 7, 8, 22, 14, 56, 27, 79, 23, 45, 14, 12] >>> insertion_sort(array, 0, len(array)) [1, 2, 4, 6, 7, 8, 8, 12,
sorts/intro_sort.py:10
↓ 1 callersFunctioninterpolate Given a list of data points (1,y0),(2,y1), ..., return a function that interpolates the data points. We find the coefficients of the interpol
project_euler/problem_101/sol1.py:113
↓ 1 callersFunctionintro_sort >>> array = [4, 2, 6, 8, 1, 7, 8, 22, 14, 56, 27, 79, 23, 45, 14, 12] >>> max_depth = 2 * math.ceil(math.log2(len(array))) >>> intro_sort
sorts/intro_sort.py:166
↓ 1 callersFunctioninverse >>> inverse([[1, 2], [3, 4]]) [[-2.0, 1.0], [1.5, -0.5]] >>> inverse([[1, 1], [1, 1]])
matrix/matrix_operation.py:141
↓ 1 callersFunctionis_combination_valid Checks if a combination (a tuple of 9 digits) is a valid product equation. >>> is_combination_valid(('3', '9', '1', '8', '6', '7', '2',
project_euler/problem_032/sol32.py:19
↓ 1 callersFunctionis_right Check if the triangle described by P(x1,y1), Q(x2,y2) and O(0,0) is right-angled. Note: this doesn't check if P and Q are equal, but that's h
project_euler/problem_091/sol1.py:17
↓ 1 callersFunctionis_safe Checking whether coordinate (row, col) is valid or not. >>> is_safe(0, 0, 5, 5) True >>> is_safe(-1,-1, 5, 5) False
matrix/max_area_of_island.py:21
↓ 1 callersFunctionis_substring_divisible
Returns True if the pandigital number passes
all the divisibility tests.
>>> is_substring_divisible((0, 1, 2, 4, 6, 5, 7, 3, 8, 9))
project_euler/problem_043/sol1.py:24
↓ 1 callersFunctionis_valid Check if a word can be placed at the given position. >>> puzzle = [ ... ['', '', '', ''], ... ['', '', '', ''], ...
backtracking/crossword_puzzle_solver.py:4