* [mypy] Fix type annotations for binary tree traversals in data structures
* Change variable name and update level_order_1 to use a deque
Using a deque instead of a list here, because since we are removing from the beginning of the list, the deque will be more efficient.
* remove duplicate function
* Update data_structures/binary_tree/binary_tree_traversals.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* fix function name at line 137
* Update data_structures/binary_tree/binary_tree_traversals.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Update data_structures/binary_tree/binary_tree_traversals.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Remove type alias and use the new syntax
* Update data_structures/binary_tree/binary_tree_traversals.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Remove prints inside functions and return lists
Co-authored-by: John Law <johnlaw.po@gmail.com>
* fix: fix mypy errors
Update binary_search_tree `arr` argument to be typed as a list
within `find_kth_smallest` function
Update return type of `merge_two_binary_trees` as both inputs can
be None which means that a None type value can be returned from
this function
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Added the matrix_exponentiation.py file in maths directory
* Implemented the requested changes
* Update matrix_exponentiation.py
* resolve merge conflict with upstream branch
* add new line at end of file
* add wavelet_tree
* fix isort issue
* updating DIRECTORY.md
* fix variable names in wavelet_tree and correct typo
* Add type hints and variable renaming
* Update data_structures/binary_tree/wavelet_tree.py
Add doctests to placate the algorithm-bot, thanks to @cclauss.
Co-authored-by: Christian Clauss <cclauss@me.com>
* Move doctest to individual functions and reformat code
* Move common test array to the global scope and reuse in tests
* MMove test array to global scope and minor linting changes
* Correct the failing pytest tests
* MUse built-in list for type annotation
* Update wavelet_tree.py
* types-requests
* updating DIRECTORY.md
* Update wavelet_tree.py
* # type: ignore
* # type: ignore
* Update decrypt_caesar_with_chi_squared.py
* ,
* Update decrypt_caesar_with_chi_squared.py
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Aniruddha Bhattacharjee <aniruddha@Aniruddhas-MacBook-Air.local>
* fixes: #2172
* fixes: #2172
* Added docstrings and type of parameters
* fixed error
* Added type hints
* made changes
* removed capital letters from function name
* Added type hints
* fixed bulid error
* modified comments
* fixed build error
* adding static type checking to basic_binary_tree.py
* Add static type checking to functions with None return type
* Applying code review comments
* Added missing import statement
* fix spaciing
* "cleaned up depth_of_tree"
* Add doctests and then streamline display() and is_full_binary_tree()
* added static typing to lazy_segment_tree.py
* added missing import statement
* modified variable names for left and right elements
* added static typing to lowest_common_ancestor.py
* fixed formatting
* modified files to meet style guidelines, edited docstrings and added some doctests
* added and fixed doctests in lazy_segment_tree.py
* fixed errors in doctests
Co-authored-by: Christian Clauss <cclauss@me.com>
* adding static type checking to basic_binary_tree.py
* Add static type checking to functions with None return type
* Applying code review comments
* Added missing import statement
* fix spaciing
* "cleaned up depth_of_tree"
* Add doctests and then streamline display() and is_full_binary_tree()
Co-authored-by: Christian Clauss <cclauss@me.com>
* Tighten up psf/black and flake8
* Fix some tests
* Fix some E741
* Fix some E741
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Fix psf/black issues than fail the build
* fixup! Format Python code with psf/black push
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* enhanced segment tree implementation and more pythonic
enhanced segment tree implementation and more pythonic
* add doctests for segment tree
* add type annotations
* unified processing sum min max segment tre
* delete source encoding in segment tree
* use a generator function instead of returning
* add doctests for methods
* add doctests for methods
* add doctests
* fix doctest
* fix doctest
* fix doctest
* fix function parameter and fix determine conditions
* spelling corrections
* review
* improved documentation, removed redundant variables, added testing
* added type hint
* camel case to snake case
* spelling fix
* review
* python --> Python # it is a brand name, not a snake
* explicit cast to int
* spaces in int list
* "!= None" to "is not None"
* Update comb_sort.py
* various spelling corrections in documentation & several variables naming conventions fix
* + char in file name
* import dependency - bug fix
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Code Upload
* Code Upload
* Delete n_possible_bst
* Find the N Possible Binary Tree and Binary Tree from given Nth Number of Node.
* Update in Test
* Update and rename n_possible_bst.py to number_of_possible_binary_trees.py
Co-authored-by: Christian Clauss <cclauss@me.com>