summaryrefslogtreecommitdiff
path: root/ds/arraylist.go
diff options
context:
space:
mode:
Diffstat (limited to 'ds/arraylist.go')
-rw-r--r--ds/arraylist.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/ds/arraylist.go b/ds/arraylist.go
index c2ada86..7bc002a 100644
--- a/ds/arraylist.go
+++ b/ds/arraylist.go
@@ -35,3 +35,9 @@ func (a ArrayList) Sorted() bool {
}
return true
}
+
+func (a ArrayList) SwapPos(i, j int) {
+ tmp := a[i]
+ a[i] = a[j]
+ a[j] = tmp
+}