R/methods_pop.R, R/ds_deque.R, R/ds_heap.R
pop-methods.RdRemove and return the first element from a data structure that
has a priority, such as a heap or deque.
pop(obj) # S4 method for deque pop(obj) # S4 method for heap pop(obj)
| obj | the object to pop an element from |
|---|
returns the first element from obj as list
#> <environment: 0x558eb1afa7a0>#> a #> 1 1# pops from a fibonacci heap b_heap <- binomial_heap() b_heap <- insert(b_heap, letters[seq(3)], list(1, diag(3), rnorm(2))) pop(b_heap)#> $a #> [1] 1 #>