Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sybilStack

A Data Type Providing Stack (LIFO) And Queue (FIFO) Functionality


Description

These functions implement simple stack or queue functionality.

Usage

stinit(stname)
  stclear(stname)
  stpush(stname, value)
  stpop(stname)
  stunshift(stname, value)
  stshift(stname)
  stseek(stname)
  stfirst(stname)
  stlist(stname)
  stlength(stname)
  stexists(stname)

Arguments

stname

A single character string, giving the name of the stack or queue.

value

Value to add to the stack or queue.

Details

The funtion stinit creates an empty stack named stname.

The funtion stclear removes the stack named stname.

The funtion stpush appends element value at the end of the stack named stname.

The funtion stpop removes the last element of the stack named stname and returns it invisible.

The funtion stunshift appends element value at the beginning of the stack stname.

The funtion stshift removes the first element of the stack named stname and returns it invisible.

The funtion stseek returns the last element of the stack named stname but does not remove it.

The funtion stfirst returns the first element of the stack named stname but does not remove it.

The funtion stlist returns the stack named stname as list.

The funtion stlength returns the number of elements stored in the stack named stname.

The funtion stexists returns TRUE if a stack named stname exists, otherwise FALSE.

Value

The functions stpop and stshift return the last/first element of the stack invisibly. The functions stseek and stfirst just return the last/first element.

Author(s)

Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de>

Maintainer: Mayo Roettger <mayo.roettger@hhu.de>

Examples

## initialize empty stack named test
  stinit("test")

  ## add a few elemets
  stpush("test", 9)
  stpush("test", 3)
  stpush("test", 7)

  ## get last element
  stpop("test")

  ## remove stack
  stclear("test")

sybil

Efficient Constrained Based Modelling

v2.1.5
GPL-3 | file LICENSE
Authors
Mayo Roettger [cre], Gabriel Gelius-Dietrich [aut], C. Jonathan Fritzemeier [ctb], Rajen Piernikarczyk [ctb], Marc Andre Daxer [ctb], Benjamin Braasch [ctb], Abdelmoneim Desouki [ctb], Martin J. Lercher [ctb]
Initial release
2019-03-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.