empty {rstackdeque} | R Documentation |
Check if an rstack, rdeque, or rpqueue is empty.
empty(x, ...)
x |
rstack, rdeque, or rpqueue to check. |
... |
additional arguments to be passed to or from methods (ignored). |
Runs in O(1)
time for all types.
logical vector of length 1.
s <- rstack()
print(empty(s)) ## TRUE
s <- insert_top(s, "a")
print(empty(s)) ## FALSE