mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
Optimized recursive_bubble_sort (#2410)
* optimized recursive_bubble_sort * Fixed doctest error due whitespace * reduce loop times for optimization * fixup! Format Python code with psf/black push Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@ -13,10 +13,10 @@ def generate_all_subsequences(sequence):
|
||||
|
||||
def create_state_space_tree(sequence, current_subsequence, index):
|
||||
"""
|
||||
Creates a state space tree to iterate through each branch using DFS.
|
||||
We know that each state has exactly two children.
|
||||
It terminates when it reaches the end of the given sequence.
|
||||
"""
|
||||
Creates a state space tree to iterate through each branch using DFS.
|
||||
We know that each state has exactly two children.
|
||||
It terminates when it reaches the end of the given sequence.
|
||||
"""
|
||||
|
||||
if index == len(sequence):
|
||||
print(current_subsequence)
|
||||
|
Reference in New Issue
Block a user