Skip to content

Commit

Permalink
Create as interface
Browse files Browse the repository at this point in the history
  • Loading branch information
lrleon committed Apr 13, 2021
1 parent 0667a5e commit 80a75d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion treaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ func NewTreap(less func(i1, i2 interface{}) bool, items ...interface{}) *Treap {
return New(time.Now().UTC().UnixNano(), less, items...)
}

func (tree *Treap) Create(items ...interface{}) interface{} {
return New(time.Now().UTC().UnixNano(), tree.Less, items...)
}

// Helper function that perform an exact topological Copy of tree rooted by p
func __copy(p *Node) *Node {

Expand All @@ -135,7 +139,7 @@ func __copy(p *Node) *Node {
}
}

// Get an exact Copy of tree
// Copy Get an exact Copy of tree
func (tree *Treap) Copy() *Treap {

ret := New(tree.seed, tree.Less)
Expand Down

0 comments on commit 80a75d5

Please sign in to comment.