Accueil >  Term: cactus stack
cactus stack

A variant of stack in which one other cactus stack may be attached to the top. An attached stack is called a "branch." When a branch becomes empty, it is removed. Pop is not allowed if there is a branch. A branch is only accessible through the original reference; it is not accessible through the stack. Formal Definition: The operations new to this variant of stack, branch(S, T) and notch(v), may be defined with axiomatic semantics as follows.

  1. top(branch(S, T)) = top(S)
  2. notch(new()) = false
  3. notch(push(v, S)) = false
  4. notch(branch(S, T)) = true

0 0

Créateur

  • GeorgeV
  •  (Gold) 1123 points
  • 100% positive feedback
© 2024 CSOFT International, Ltd.