Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Andrew Childs
reversal-sort
Commits
0d0d0679
Commit
0d0d0679
authored
Feb 24, 2021
by
Eddie Schoute
Browse files
Remove old code
parent
ed399785
Changes
1
Hide whitespace changes
Inline
Side-by-side
TripartiteBinarySort.py
View file @
0d0d0679
...
...
@@ -73,11 +73,6 @@ def perm_to_01(L, i, j):
median
=
(
j
-
i
)
//
2
return
L
[:
i
]
+
[
int
(
sorted_subseq
.
index
(
k
)
>
median
)
for
k
in
subseq
]
+
L
[
j
+
1
:]
def
permutationsort_divideconquer_tbs
(
L
):
"""Routes the given permutation using reversals. Returns the reversals"""
j
=
max
(
L
)
return
permutationsort_divideconquer_tbs
(
L
,
0
,
j
)
def
permutationsort_divideconquer_tbs
(
L
,
i
=
None
,
j
=
None
):
"""
Sorts the given permutations L from index i to j (inclusive) using a divide and conquer approach. Returns a list of
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment