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
ed399785
Commit
ed399785
authored
Feb 24, 2021
by
Eddie Schoute
Browse files
Add repr to Reversal for pretty print
parent
0e835b88
Changes
1
Hide whitespace changes
Inline
Side-by-side
SBR.py
View file @
ed399785
...
@@ -35,9 +35,12 @@ class Reversal:
...
@@ -35,9 +35,12 @@ class Reversal:
def
__lt__
(
self
,
other
):
def
__lt__
(
self
,
other
):
return
self
.
beg
<
other
.
beg
return
self
.
beg
<
other
.
beg
def
__
st
r__
(
self
):
def
__
rep
r__
(
self
):
return
"("
+
str
(
self
.
beg
)
+
", "
+
str
(
self
.
end
)
+
")"
return
"("
+
str
(
self
.
beg
)
+
", "
+
str
(
self
.
end
)
+
")"
def
__str__
(
self
):
return
repr
(
self
)
# Perform the given reversal on the given permutation
# Perform the given reversal on the given permutation
def
reverse
(
permutation
,
reversal
):
def
reverse
(
permutation
,
reversal
):
...
...
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