Wavelet tree #4267
Wavelet tree #4267
Conversation
Click here to look at the relevant links
|
|
|
||
|
|
||
| class Node: | ||
| def __init__(self, n): |
algorithms-keeper
bot
Mar 14, 2021
Please provide return type hint for the function: __init__. If the function does not return a value, please provide the type hint as: def function() -> None:
Please provide descriptive name for the parameter: n
Please provide type hint for the parameter: n
Please provide return type hint for the function: __init__. If the function does not return a value, please provide the type hint as: def function() -> None:
Please provide descriptive name for the parameter: n
Please provide type hint for the parameter: n
| self.left: Optional[Node] = None | ||
| self.right: Optional[Node] = None | ||
|
|
||
| def __repr__(self): |
algorithms-keeper
bot
Mar 14, 2021
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function __repr__
Please provide return type hint for the function: __repr__. If the function does not return a value, please provide the type hint as: def function() -> None:
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function __repr__
Please provide return type hint for the function: __repr__. If the function does not return a value, please provide the type hint as: def function() -> None:
| return root | ||
|
|
||
|
|
||
| def rank_from_start(node: Node, num: int, i: int) -> int: |
algorithms-keeper
bot
Mar 14, 2021
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function rank_from_start
Please provide descriptive name for the parameter: i
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function rank_from_start
Please provide descriptive name for the parameter: i
| return rank_from_start(node.right, num, i - node.map_left[i]) | ||
|
|
||
|
|
||
| def rank(node: Node, num: int, i: int, j: int) -> int: |
algorithms-keeper
bot
Mar 14, 2021
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function rank
Please provide descriptive name for the parameter: i
Please provide descriptive name for the parameter: j
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function rank
Please provide descriptive name for the parameter: i
Please provide descriptive name for the parameter: j
| return rank_till_j - rank_before_i | ||
|
|
||
|
|
||
| def quantile(node: Node, k: int, i: int, j: int) -> int: |
algorithms-keeper
bot
Mar 14, 2021
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function quantile
Please provide descriptive name for the parameter: k
Please provide descriptive name for the parameter: i
Please provide descriptive name for the parameter: j
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function quantile
Please provide descriptive name for the parameter: k
Please provide descriptive name for the parameter: i
Please provide descriptive name for the parameter: j
| ) | ||
|
|
||
|
|
||
| def range_counting(node: Node, i: int, j: int, x: int, y: int) -> int: |
algorithms-keeper
bot
Mar 14, 2021
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function range_counting
Please provide descriptive name for the parameter: i
Please provide descriptive name for the parameter: j
Please provide descriptive name for the parameter: x
Please provide descriptive name for the parameter: y
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function range_counting
Please provide descriptive name for the parameter: i
Please provide descriptive name for the parameter: j
Please provide descriptive name for the parameter: x
Please provide descriptive name for the parameter: y
| return left + right | ||
|
|
||
|
|
||
| def main(): |
algorithms-keeper
bot
Mar 14, 2021
Please provide return type hint for the function: main. If the function does not return a value, please provide the type hint as: def function() -> None:
Please provide return type hint for the function: main. If the function does not return a value, please provide the type hint as: def function() -> None:
…nto wavelet_tree Maintain consistency between the local and remote branch
Click here to look at the relevant links
|
|
|
||
|
|
||
| class Node: | ||
| def __init__(self, length): |
algorithms-keeper
bot
Mar 14, 2021
Please provide return type hint for the function: __init__. If the function does not return a value, please provide the type hint as: def function() -> None:
Please provide type hint for the parameter: length
Please provide return type hint for the function: __init__. If the function does not return a value, please provide the type hint as: def function() -> None:
Please provide type hint for the parameter: length
| self.left: Optional[Node] = None | ||
| self.right: Optional[Node] = None | ||
|
|
||
| def __repr__(self): |
algorithms-keeper
bot
Mar 14, 2021
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function __repr__
Please provide return type hint for the function: __repr__. If the function does not return a value, please provide the type hint as: def function() -> None:
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function __repr__
Please provide return type hint for the function: __repr__. If the function does not return a value, please provide the type hint as: def function() -> None:
| return root | ||
|
|
||
|
|
||
| def rank_from_start(node: Node, num: int, index: int) -> int: |
algorithms-keeper
bot
Mar 14, 2021
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function rank_from_start
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function rank_from_start
| return rank_till_end - rank_before_start | ||
|
|
||
|
|
||
| def quantile(node: Node, k: int, start: int, end: int) -> int: |
algorithms-keeper
bot
Mar 14, 2021
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function quantile
Please provide descriptive name for the parameter: k
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function quantile
Please provide descriptive name for the parameter: k
| ) | ||
|
|
||
|
|
||
| def range_counting(node: Node, start: int, end: int, x: int, y: int) -> int: |
algorithms-keeper
bot
Mar 14, 2021
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function range_counting
Please provide descriptive name for the parameter: x
Please provide descriptive name for the parameter: y
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function range_counting
Please provide descriptive name for the parameter: x
Please provide descriptive name for the parameter: y
Click here to look at the relevant links
|
| return root | ||
|
|
||
|
|
||
| def rank_from_start(node: Node, num: int, index: int) -> int: |
algorithms-keeper
bot
Mar 14, 2021
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function rank_from_start
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function rank_from_start
Add doctests to placate the algorithm-bot, thanks to @cclauss. Co-authored-by: Christian Clauss <cclauss@me.com>
Click here to look at the relevant links
|
| return root | ||
|
|
||
|
|
||
| def rank_from_start(node: Node, num: int, index: int) -> int: |
algorithms-keeper
bot
Mar 27, 2021
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function rank_from_start
As there is no test file in this pull request nor any test function or class in the file data_structures/binary_tree/wavelet_tree.py, please provide doctest for the function rank_from_start
|
Let's get a review from @dhruvmanila first... |
|
Thanks for the heads up! I will take a look at it today. |
|
Just following up for any updates on this. |
|
Just following up for any updates. |
|
@cclauss @dhruvmanila just following up for any updates on this PR. |
|
Close and reopen to rebase… |


Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.