summaryrefslogtreecommitdiff
path: root/ds/arraylist.go
diff options
context:
space:
mode:
Diffstat (limited to 'ds/arraylist.go')
-rw-r--r--ds/arraylist.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/ds/arraylist.go b/ds/arraylist.go
index 8e99384..e0e4536 100644
--- a/ds/arraylist.go
+++ b/ds/arraylist.go
@@ -8,6 +8,10 @@ import (
type ArrayList []int
+func NewArrayList(l int) ArrayList {
+ return make(ArrayList, l)
+}
+
func NewRandomArrayList(l, max int) ArrayList {
a := make(ArrayList, l)
for i := 0; i < l; i++ {