Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/VDM/VDMPP/SSlibE2PP/   (Wiener Entwicklungsmethode ©)  Datei vom 13.4.2020 mit Größe 485 B image not shown  

Quelle  Queue.vdmpp   Sprache: VDM

 
class Queue

functions
static public empty[@T] : () -> seq of @T
empty() == [];

static public isEmpty[@T] : seq of @T -> bool
isEmpty(s) == s = [];
 
static public enQueue[@T] : @T * seq of @T -> seq of @T
enQueue(anElem, aQueue) == aQueue ^ [anElem];

static public deQueue[@T] : seq of @T -> seq of @T
deQueue(aQueue) == 
 if aQueue = [] then
  []
 else
  tl aQueue;

static public top[@T] : seq of @T -> [@T]
top(aQueue) == 
 if aQueue = [] then
  nil
 else
  hd aQueue;

end Queue

100%


¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.