Minimal examples of data structures and algorithms in Python
1570 matches across 11 categories. Click a row to expand file-level details.
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | algorithms/tree/path_sum.py | 23 | Check if a root-to-leaf path with the given sum exists (recursive). Args: root: The root of the binary tree |
| HIGH | algorithms/tree/path_sum.py | 45 | Check if a root-to-leaf path with the given sum exists (DFS with stack). Args: root: The root of the binary |
| HIGH | algorithms/tree/path_sum.py | 73 | Check if a root-to-leaf path with the given sum exists (BFS with queue). Args: root: The root of the binary |
| HIGH | algorithms/tree/max_path_sum.py | 21 | Find the maximum path sum in a binary tree. Args: root: The root of the binary tree. Returns: |
| HIGH | algorithms/tree/same_tree.py | 20 | Check whether two binary trees are identical. Args: tree_p: The root of the first binary tree. tree |
| HIGH | algorithms/tree/is_balanced.py | 20 | Check whether a binary tree is height-balanced. Args: root: The root of the binary tree. Returns: |
| HIGH | algorithms/tree/binary_tree_paths.py | 20 | Return all root-to-leaf paths in the binary tree. Args: root: The root of the binary tree. Returns: |
| HIGH | algorithms/tree/pretty_print.py | 18 | Format a dictionary tree as a list of readable strings. Each top-level key maps to a list of sub-elements. The outp |
| HIGH | algorithms/tree/is_symmetric.py | 20 | Check whether a binary tree is symmetric using recursion. Args: root: The root of the binary tree. Ret |
| HIGH | algorithms/tree/is_symmetric.py | 55 | Check whether a binary tree is symmetric using iteration. Args: root: The root of the binary tree. Ret |
| HIGH | algorithms/tree/is_subtree.py | 22 | Check whether the small tree is a subtree of the big tree. Args: big: The root of the larger tree. |
| HIGH | algorithms/tree/max_height.py | 22 | Compute the maximum depth of a binary tree using iterative BFS. Args: root: The root of the binary tree. |
| HIGH | algorithms/tree/min_height.py | 37 | Compute the minimum depth of a binary tree using iterative BFS. Args: root: The root of the binary tree. |
| HIGH | algorithms/tree/bin_tree_to_list.py | 20 | Convert a binary tree to a sorted doubly linked list. Args: root: The root of the binary tree. Returns |
| HIGH | algorithms/tree/construct_tree_postorder_preorder.py | 25 | Recursively construct a binary tree from preorder and postorder arrays. Uses a global pre_index to track the curren |
| HIGH | algorithms/tree/construct_tree_postorder_preorder.py | 72 | Construct a full binary tree and return its inorder traversal. Args: pre: The preorder traversal array. |
| HIGH | algorithms/tree/lowest_common_ancestor.py | 21 | Find the lowest common ancestor of two nodes in a binary tree. Args: root: The root of the binary tree. |
| HIGH | algorithms/tree/path_sum2.py | 22 | Find all root-to-leaf paths with the given sum (recursive DFS). Args: root: The root of the binary tree. |
| HIGH | algorithms/tree/path_sum2.py | 61 | Find all root-to-leaf paths with the given sum (DFS with stack). Args: root: The root of the binary tree. |
| HIGH | algorithms/tree/path_sum2.py | 90 | Find all root-to-leaf paths with the given sum (BFS with queue). Args: root: The root of the binary tree. |
| HIGH | algorithms/tree/longest_consecutive.py | 20 | Find the length of the longest parent-to-child consecutive sequence. Args: root: The root of the binary tre |
| HIGH | algorithms/tree/binary_tree_views.py | 28 | Return the values visible from the left side of the tree. Args: root: Root of the binary tree. Returns |
| HIGH | algorithms/tree/binary_tree_views.py | 60 | Return the values visible from the right side of the tree. Args: root: Root of the binary tree. Return |
| HIGH | algorithms/tree/binary_tree_views.py | 92 | Return the values visible when looking at the tree from above. Nodes are ordered by horizontal distance from root ( |
| HIGH | algorithms/tree/binary_tree_views.py | 126 | Return the values visible when looking at the tree from below. Nodes are ordered by horizontal distance from root ( |
| HIGH | algorithms/data_structures/b_tree.py | 124 | Search for a key in the B-tree. Args: key: The key to search for. Returns: Tru |
| HIGH | algorithms/data_structures/veb_tree.py | 155 | Check whether element x exists in the tree. Args: x (int): Element to check. Retu |
| HIGH | algorithms/data_structures/veb_tree.py | 176 | Return the smallest element greater than x in the tree. Args: x (int): Element to find suc |
| HIGH | algorithms/data_structures/sqrt_decomposition.py | 61 | Set ``data[index]`` to *value* and update the block sum. Args: index: Array index to update. |
| HIGH | algorithms/data_structures/sqrt_decomposition.py | 85 | Return the sum of elements from *left* to *right* inclusive. Args: left: Start index (inclusive). |
| HIGH | …gorithms/bit_manipulation/flip_bit_longest_sequence.py | 18 | Find the longest 1-bit run achievable by flipping a single 0-bit. Tracks the current run length and the previous ru |
| HIGH | algorithms/bit_manipulation/count_ones.py | 18 | Count set bits using Brian Kernighan's algorithm (recursive). Args: number: A non-negative integer. Re |
| HIGH | algorithms/bit_manipulation/count_ones.py | 38 | Count set bits using Brian Kernighan's algorithm (iterative). Args: number: A non-negative integer. Re |
| HIGH | algorithms/bit_manipulation/binary_gap.py | 19 | Find the longest distance between consecutive 1-bits in binary. Args: number: A positive integer to examine |
| HIGH | algorithms/bit_manipulation/remove_bit.py | 18 | Remove the bit at a specific position from an integer. Splits the number around *position*, shifts the upper part r |
| HIGH | algorithms/bit_manipulation/reverse_bits.py | 17 | Reverse all 32 bits of an unsigned integer. Args: number: A 32-bit unsigned integer (0 to 2**32 - 1). |
| HIGH | algorithms/bit_manipulation/swap_pair.py | 18 | Swap every pair of adjacent bits in an integer. Masks odd-positioned bits (0xAAAAAAAA), shifts them right by one, |
| HIGH | algorithms/bit_manipulation/bit_operation.py | 18 | Get the bit value at a specific position. Shifts 1 over by *position* bits and ANDs with *number* to isolate th |
| HIGH | algorithms/bit_manipulation/bit_operation.py | 40 | Set the bit at a specific position to 1. Shifts 1 over by *position* bits and ORs with *number* so that only th |
| HIGH | algorithms/bit_manipulation/bit_operation.py | 60 | Clear the bit at a specific position to 0. Creates a mask with all bits set except at *position*, then ANDs wit |
| HIGH | algorithms/bit_manipulation/bit_operation.py | 81 | Update the bit at a specific position to a given value. First clears the bit at *position*, then ORs in the new *bi |
| HIGH | algorithms/bit_manipulation/single_number3.py | 19 | Find the two elements that each appear exactly once. Uses XOR to isolate the combined signature of the two unique v |
| HIGH | algorithms/bit_manipulation/single_number2.py | 19 | Find the element that appears once (all others appear three times). Uses two accumulators (*ones* and *twos*) to tr |
| HIGH | algorithms/bit_manipulation/insert_bit.py | 17 | Insert a single bit at a specific position in an integer. Splits the number at *position*, shifts the upper part le |
| HIGH | algorithms/bit_manipulation/insert_bit.py | 44 | Insert multiple bits at a specific position in an integer. Splits the number at *position*, shifts the upper part l |
| HIGH | algorithms/bit_manipulation/count_flips_to_convert.py | 19 | Count the number of bit flips needed to convert one integer to another. Args: first: The source integer. |
| HIGH | algorithms/bit_manipulation/power_of_two.py | 19 | Check whether an integer is a power of two. Args: number: The integer to test. Returns: True i |
| HIGH | algorithms/bit_manipulation/single_number.py | 18 | Find the element that appears only once (all others appear twice). XORs all values together; paired values cancel t |
| HIGH | algorithms/bit_manipulation/add_bitwise_operator.py | 18 | Add two non-negative integers using only bitwise operations. Args: first: First non-negative integer operan |
| HIGH | algorithms/bit_manipulation/subsets.py | 18 | Return all subsets of the given list as a set of tuples. Uses bitmask enumeration: for each number from 0 to 2^n - |
| HIGH | algorithms/bit_manipulation/bytes_int_conversion.py | 20 | Convert a non-negative integer to bytes in big-endian order. Args: number: A non-negative integer to conver |
| HIGH | algorithms/bit_manipulation/bytes_int_conversion.py | 40 | Convert a non-negative integer to bytes in little-endian order. Args: number: A non-negative integer to con |
| HIGH | algorithms/bit_manipulation/bytes_int_conversion.py | 60 | Convert a big-endian byte sequence to an integer. Args: byte_string: Bytes with the most significant byte f |
| HIGH | algorithms/bit_manipulation/bytes_int_conversion.py | 80 | Convert a little-endian byte sequence to an integer. Args: byte_string: Bytes with the least significant by |
| HIGH | algorithms/bit_manipulation/find_difference.py | 18 | Find the single character added to a shuffled copy of a string. Uses XOR on all character code points; paired chara |
| HIGH | algorithms/bit_manipulation/find_missing_number.py | 19 | Find the missing number using XOR. XORs every element with its expected index so that all paired values cancel |
| HIGH | algorithms/bit_manipulation/find_missing_number.py | 44 | Find the missing number using arithmetic summation. Computes the expected sum of 0..n and subtracts the actual sum |
| HIGH | algorithms/bit_manipulation/has_alternative_bit.py | 18 | Check for alternating bits by scanning each pair of adjacent bits. Args: number: A positive integer to chec |
| HIGH | algorithms/bit_manipulation/has_alternative_bit.py | 47 | Check for alternating bits using O(1) bitmask arithmetic. Args: number: A positive integer to check. R |
| HIGH | algorithms/array/longest_non_repeat.py | 18 | Find the length of the longest substring without repeating characters. Args: string: Input string to search |
| 392 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | algorithms/__init__.py | 10 | |
| LOW | algorithms/__init__.py | 11 | |
| LOW | algorithms/__init__.py | 11 | |
| LOW | algorithms/__init__.py | 11 | |
| LOW | algorithms/tree/path_sum.py | 15 | |
| LOW | algorithms/tree/max_path_sum.py | 15 | |
| LOW | algorithms/tree/same_tree.py | 14 | |
| LOW | algorithms/tree/tree.py | 7 | |
| LOW | algorithms/tree/invert_tree.py | 13 | |
| LOW | algorithms/tree/is_balanced.py | 14 | |
| LOW | algorithms/tree/binary_tree_paths.py | 14 | |
| LOW | algorithms/tree/pretty_print.py | 14 | |
| LOW | algorithms/tree/is_symmetric.py | 14 | |
| LOW | algorithms/tree/is_subtree.py | 14 | |
| LOW | algorithms/tree/__init__.py | 8 | |
| LOW | algorithms/tree/__init__.py | 9 | |
| LOW | algorithms/tree/__init__.py | 10 | |
| LOW | algorithms/tree/__init__.py | 11 | |
| LOW | algorithms/tree/__init__.py | 12 | |
| LOW | algorithms/tree/__init__.py | 12 | |
| LOW | algorithms/tree/__init__.py | 12 | |
| LOW | algorithms/tree/__init__.py | 12 | |
| LOW | algorithms/tree/__init__.py | 18 | |
| LOW | algorithms/tree/__init__.py | 18 | |
| LOW | algorithms/tree/__init__.py | 22 | |
| LOW | algorithms/tree/__init__.py | 22 | |
| LOW | algorithms/tree/__init__.py | 23 | |
| LOW | algorithms/tree/__init__.py | 24 | |
| LOW | algorithms/tree/__init__.py | 25 | |
| LOW | algorithms/tree/__init__.py | 26 | |
| LOW | algorithms/tree/__init__.py | 26 | |
| LOW | algorithms/tree/__init__.py | 27 | |
| LOW | algorithms/tree/__init__.py | 28 | |
| LOW | algorithms/tree/__init__.py | 29 | |
| LOW | algorithms/tree/__init__.py | 30 | |
| LOW | algorithms/tree/__init__.py | 31 | |
| LOW | algorithms/tree/__init__.py | 31 | |
| LOW | algorithms/tree/__init__.py | 32 | |
| LOW | algorithms/tree/__init__.py | 32 | |
| LOW | algorithms/tree/__init__.py | 32 | |
| LOW | algorithms/tree/__init__.py | 33 | |
| LOW | algorithms/tree/__init__.py | 33 | |
| LOW | algorithms/tree/__init__.py | 33 | |
| LOW | algorithms/tree/__init__.py | 34 | |
| LOW | algorithms/tree/__init__.py | 35 | |
| LOW | algorithms/tree/__init__.py | 36 | |
| LOW | algorithms/tree/max_height.py | 14 | |
| LOW | algorithms/tree/min_height.py | 14 | |
| LOW | algorithms/tree/bin_tree_to_list.py | 14 | |
| LOW | algorithms/tree/construct_tree_postorder_preorder.py | 15 | |
| LOW | algorithms/tree/lowest_common_ancestor.py | 15 | |
| LOW | algorithms/tree/path_sum2.py | 14 | |
| LOW | algorithms/tree/longest_consecutive.py | 14 | |
| LOW | algorithms/tree/binary_tree_views.py | 20 | |
| LOW | algorithms/tree/deepest_left.py | 14 | |
| LOW | algorithms/data_structures/queue.py | 14 | |
| LOW | …rithms/data_structures/separate_chaining_hash_table.py | 14 | |
| LOW | algorithms/data_structures/heap.py | 15 | |
| LOW | algorithms/data_structures/hash_table.py | 15 | |
| LOW | algorithms/data_structures/b_tree.py | 15 | |
| 830 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | algorithms/data_structures/b_tree.py | 281 | def _remove_from_nonleaf_node( |
| LOW | algorithms/data_structures/b_tree.py | 304 | def _find_largest_and_delete_in_left_subtree(self, node: Node) -> int: |
| LOW | algorithms/data_structures/b_tree.py | 323 | def _find_largest_and_delete_in_right_subtree(self, node: Node) -> int: |
| LOW | algorithms/bit_manipulation/bytes_int_conversion.py | 39 | def int_to_bytes_little_endian(number: int) -> bytes: |
| LOW | algorithms/bit_manipulation/bytes_int_conversion.py | 79 | def bytes_little_endian_to_int(byte_string: bytes) -> int: |
| LOW | algorithms/array/n_sum.py | 102 | def _append_elem_to_each_list( |
| LOW | algorithms/backtracking/array_sum_combinations.py | 78 | def unique_array_sum_combinations( |
| LOW | algorithms/backtracking/palindrome_partitioning.py | 43 | def palindromic_substrings_iter(text: str) -> Generator[list[str], None, None]: |
| LOW | algorithms/graph/bellman_ford.py | 58 | def _initialize_single_source( |
| LOW | …thms/dynamic_programming/longest_common_subsequence.py | 16 | def longest_common_subsequence(s_1: str, s_2: str) -> int: |
| LOW | algorithms/dynamic_programming/longest_increasing.py | 23 | def longest_increasing_subsequence(sequence: list[int]) -> int: |
| LOW | algorithms/dynamic_programming/longest_increasing.py | 45 | def longest_increasing_subsequence_optimized(sequence: list[int]) -> int: |
| LOW | algorithms/dynamic_programming/max_product_subarray.py | 45 | def subarray_with_max_product(arr: list[int]) -> tuple[int, list[int]]: |
| LOW | algorithms/dynamic_programming/combination_sum.py | 61 | def combination_sum_bottom_up(nums: list[int], target: int) -> int: |
| LOW | algorithms/math/diffie_hellman_key_exchange.py | 186 | def diffie_hellman_key_exchange(a: int, p: int, option: int | None = None) -> bool: |
| LOW | algorithms/math/distance_between_two_points.py | 19 | def distance_between_two_points(x1: float, y1: float, x2: float, y2: float) -> float: |
| LOW | algorithms/math/recursive_binomial_coefficient.py | 17 | def recursive_binomial_coefficient(n: int, k: int) -> int: |
| LOW | algorithms/math/symmetry_group_cycle_index.py | 49 | def cycle_product_for_two_polynomials( |
| LOW | algorithms/streaming/one_sparse_recovery.py | 51 | def _check_bit_sum_consistency(bitsum: list[int], sum_signs: int) -> bool: |
| LOW | algorithms/map/longest_palindromic_subsequence.py | 17 | def longest_palindromic_subsequence(s: str) -> int: |
| LOW | algorithms/compression/huffman_coding.py | 62 | def get_number_of_additional_bits_in_the_last_byte(self) -> int: |
| LOW | algorithms/compression/huffman_coding.py | 218 | def _save_information_about_additional_bits(self, additional_bits: int) -> None: |
| LOW | algorithms/compression/huffman_coding.py | 302 | def _decode_and_write_signs_to_file( |
| LOW | algorithms/compression/huffman_coding.py | 357 | def _encode_and_write_signs_to_file( |
| LOW | algorithms/compression/huffman_coding.py | 438 | def _go_through_tree_and_create_codes( |
| LOW | algorithms/greedy/max_contiguous_subsequence_sum.py | 17 | def max_contiguous_subsequence_sum(arr: list[int]) -> int: |
| LOW | algorithms/string/delete_reoccurring.py | 17 | def delete_reoccurring_characters(string: str) -> str: |
| LOW | algorithms/string/is_palindrome.py | 98 | def is_palindrome_two_pointer(text: str) -> bool: |
| LOW | algorithms/string/fizzbuzz.py | 53 | def fizzbuzz_with_helper_func(number: int) -> list[int | str]: |
| LOW | algorithms/string/longest_common_prefix.py | 98 | def _longest_common_recursive(strings: list[str], left: int, right: int) -> str: |
| LOW | algorithms/string/validate_coordinates.py | 68 | def is_valid_coordinates_regular_expression(coordinates: str) -> bool: |
| LOW | algorithms/matrix/search_in_sorted_matrix.py | 18 | def search_in_a_sorted_matrix( |
| LOW | algorithms/matrix/sparse_dot_vector.py | 17 | def vector_to_index_value_list( |
| LOW | algorithms/matrix/crout_matrix_decomposition.py | 19 | def crout_matrix_decomposition( |
| LOW | tests/test_iterative_segment_tree.py | 18 | def test_segment_tree_creation(self): |
| LOW | tests/test_iterative_segment_tree.py | 53 | def test_max_segment_tree_with_updates(self): |
| LOW | tests/test_iterative_segment_tree.py | 71 | def test_min_segment_tree_with_updates(self): |
| LOW | tests/test_iterative_segment_tree.py | 89 | def test_sum_segment_tree_with_updates(self): |
| LOW | tests/test_iterative_segment_tree.py | 107 | def test_gcd_segment_tree_with_updates(self): |
| LOW | tests/test_iterative_segment_tree.py | 135 | def __test_all_segments_with_updates(self, arr, fnc, upd): |
| LOW | tests/test_data_structures.py | 29 | def test_insert_multiple_sorted(self): |
| LOW | tests/test_data_structures.py | 45 | def test_insert_duplicates_order(self): |
| LOW | tests/test_data_structures.py | 59 | def test_insert_multiple_root_exists(self): |
| LOW | tests/test_data_structures.py | 65 | def test_balanced_after_insert(self): |
| LOW | tests/test_data_structures.py | 77 | def test_in_order_traverse_populated(self): |
| LOW | tests/test_data_structures.py | 83 | def test_insert_balance_factor(self): |
| LOW | tests/test_data_structures.py | 147 | def test_count_decrements_on_unite(self): |
| LOW | tests/test_data_structures.py | 162 | def test_transitive_connectivity(self): |
| LOW | tests/test_data_structures.py | 180 | def test_single_element_query(self): |
| LOW | tests/test_data_structures.py | 233 | def test_resizes_automatically(self): |
| LOW | tests/test_tree.py | 63 | def test_insertion_and_find_even_degree(self): |
| LOW | tests/test_tree.py | 72 | def test_insertion_and_find_odd_degree(self): |
| LOW | tests/test_tree.py | 81 | def test_deletion_even_degree(self): |
| LOW | tests/test_backtracking.py | 75 | def test_array_sum_combinations(self): |
| LOW | tests/test_backtracking.py | 97 | def test_unique_array_sum_combinations(self): |
| LOW | tests/test_backtracking.py | 140 | def test_recursive_get_factors(self): |
| LOW | tests/test_backtracking.py | 194 | def test_generate_abbreviations(self): |
| LOW | tests/test_backtracking.py | 269 | def test_generate_parenthesis(self): |
| LOW | tests/test_backtracking.py | 294 | def test_palindromic_substrings(self): |
| LOW | tests/test_stack.py | 72 | def test_is_valid_parenthesis(self): |
| 80 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | algorithms/tree/bst_delete_node.py | 14 | root = [5,3,6,2,4,null,7] |
| HIGH | algorithms/tree/bst_delete_node.py | 25 | One valid answer is [5,4,6,2,null,null,7], shown in the following BST. |
| HIGH | algorithms/tree/bst_delete_node.py | 33 | Another valid answer is [5,2,6,null,4,null,7]. |
| HIGH | algorithms/tree/traversal_zigzag.py | 8 | Given binary tree [3,9,20,null,null,15,7], |
| HIGH | algorithms/tree/traversal_level_order.py | 6 | Given binary tree [3,9,20,null,null,15,7], |
| HIGH | algorithms/data_structures/red_black_tree.py | 86 | # case 1 the parent is null, then set the inserted node as root and color = 0 |
| HIGH | algorithms/data_structures/red_black_tree.py | 106 | # case 3.2 the uncle node is black or null, |
| HIGH | algorithms/data_structures/red_black_tree.py | 129 | # case 3.2 the uncle node is black or null, |
| HIGH | algorithms/data_structures/stack.py | 63 | >>> s.push(1) |
| HIGH | algorithms/data_structures/stack.py | 142 | >>> s.push(1) |
| HIGH | algorithms/data_structures/priority_queue.py | 70 | self.push(item, priority=priority) |
| HIGH | algorithms/linked_list/copy_random_pointer.py | 5 | could point to any node in the list or null, return a deep copy of the list. |
| HIGH | algorithms/stack/ordered_stack.py | 23 | >>> s.push(3) |
| HIGH | algorithms/stack/ordered_stack.py | 24 | >>> s.push(1) |
| HIGH | algorithms/stack/ordered_stack.py | 25 | >>> s.push(2) |
| HIGH | tests/test_stack.py | 88 | stack.push(1) |
| HIGH | tests/test_stack.py | 89 | stack.push(2) |
| HIGH | tests/test_stack.py | 90 | stack.push(3) |
| HIGH | tests/test_stack.py | 121 | stack.push(1) |
| HIGH | tests/test_stack.py | 122 | stack.push(2) |
| HIGH | tests/test_stack.py | 123 | stack.push(3) |
| HIGH | tests/test_stack.py | 156 | stack.push(1) |
| HIGH | tests/test_stack.py | 157 | stack.push(4) |
| HIGH | tests/test_stack.py | 158 | stack.push(3) |
| HIGH | tests/test_stack.py | 159 | stack.push(6) |
| HIGH | tests/test_queue.py | 105 | queue.push(2) |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | algorithms/data_structures/red_black_tree.py | 85 | |
| LOW | algorithms/data_structures/red_black_tree.py | 208 | |
| LOW | algorithms/array/n_sum.py | 21 | |
| LOW | algorithms/array/n_sum.py | 80 | |
| LOW | algorithms/array/three_sum.py | 17 | |
| LOW | algorithms/array/garage.py | 18 | |
| LOW | algorithms/backtracking/permute_unique.py | 17 | |
| LOW | algorithms/backtracking/pattern_match.py | 37 | |
| LOW | algorithms/graph/traversal.py | 18 | |
| LOW | algorithms/graph/traversal.py | 44 | |
| LOW | algorithms/graph/count_islands_bfs.py | 20 | |
| LOW | algorithms/graph/bellman_ford.py | 18 | |
| LOW | algorithms/graph/all_pairs_shortest_path.py | 19 | |
| LOW | algorithms/graph/word_ladder.py | 20 | |
| LOW | algorithms/graph/maximum_flow_dfs.py | 20 | |
| LOW | algorithms/graph/maximum_flow_bfs.py | 21 | |
| LOW | algorithms/graph/topological_sort_dfs.py | 59 | |
| LOW | algorithms/graph/check_bipartite.py | 18 | |
| LOW | algorithms/graph/blossom.py | 17 | |
| LOW | algorithms/graph/blossom.py | 35 | |
| LOW | algorithms/graph/maximum_flow.py | 85 | |
| LOW | …thms/dynamic_programming/longest_common_subsequence.py | 16 | |
| LOW | algorithms/dynamic_programming/regex_matching.py | 17 | |
| LOW | algorithms/dynamic_programming/matrix_chain_order.py | 19 | |
| LOW | algorithms/dynamic_programming/int_divide.py | 17 | |
| LOW | algorithms/dynamic_programming/k_factor.py | 18 | |
| LOW | algorithms/dynamic_programming/egg_drop.py | 19 | |
| LOW | algorithms/linked_list/is_palindrome.py | 85 | |
| LOW | algorithms/math/polynomial.py | 319 | |
| LOW | algorithms/math/polynomial.py | 388 | |
| LOW | algorithms/math/polynomial.py | 435 | |
| LOW | algorithms/math/polynomial.py | 484 | |
| LOW | algorithms/streaming/misra_gries.py | 18 | |
| LOW | algorithms/map/longest_palindromic_subsequence.py | 17 | |
| LOW | algorithms/compression/huffman_coding.py | 302 | |
| LOW | algorithms/sorting/cycle_sort.py | 18 | |
| LOW | algorithms/string/breaking_bad.py | 80 | |
| LOW | algorithms/string/strip_url_params.py | 21 | |
| LOW | algorithms/string/fizzbuzz.py | 17 | |
| LOW | algorithms/string/text_justification.py | 18 | |
| LOW | algorithms/string/atbash_cipher.py | 17 | |
| LOW | algorithms/string/decode_string.py | 18 | |
| LOW | algorithms/set/set_covering.py | 76 | |
| LOW | algorithms/matrix/sparse_mul.py | 18 | |
| LOW | algorithms/matrix/sum_sub_squares.py | 17 | |
| LOW | algorithms/matrix/matrix_inversion.py | 21 | |
| LOW | algorithms/matrix/sudoku_validator.py | 20 |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | algorithms/tree/bst_validate_bst.py | 1 | # =============================================================================== |
| MEDIUM | algorithms/tree/bst_validate_bst.py | 13 | # =============================================================================== |
| MEDIUM | tests/test_issue_fixes.py | 18 | # ── Dijkstra with priority queue (#565) ──────────────────────────────── |
| MEDIUM | tests/test_issue_fixes.py | 68 | # ── Goldbach's conjecture (#908) ──────────────────────────────────────── |
| MEDIUM | tests/test_issue_fixes.py | 106 | # ── Binary tree views (#829) ──────────────────────────────────────────── |
| MEDIUM | tests/test_issue_fixes.py | 176 | # ── Square root decomposition (#651) ──────────────────────────────────── |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/test_polynomial.py | 195 | # Check if quotient from poly_long_division matches expected |
| LOW | tests/test_polynomial.py | 198 | # Check if remainder from poly_long_division matches expected |
| LOW | tests/test_polynomial.py | 201 | # Check if quotient from __truediv__ matches quotient from poly_long_division |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | algorithms/tree/bst_kth_smallest.py | 33 | def helper(self, node, count): |
| LOW | algorithms/dynamic_programming/count_paths_dp.py | 25 | def helper(i: int, j: int) -> int: |
| LOW | tests/test_searching.py | 29 | def helper(array, query): |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | algorithms/tree/bst_validate_bst.py | 70 | # Example usage |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | algorithms/tree/bst_closest_value.py | 1 | # Given a non-empty binary search tree and a target value, |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | algorithms/math/pythagoras.py | 47 | except Exception as err: |