Created
January 15, 2018 22:31
-
-
Save sunho/8be2714833e77c2e1b794c83c9805e03 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Sequence []int | |
// Methods required by sort.Interface. | |
func (s Sequence) Len() int { | |
return len(s) | |
} | |
func (s Sequence) Less(i, j int) bool { | |
return s[i] < s[j] | |
} | |
func (s Sequence) Swap(i, j int) { | |
s[i], s[j] = s[j], s[i] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment