מבני נתונים ואלגוריתמים - מחברת קורס/מבני נתונים/מחסניות: הבדלים בין גרסאות בדף
תוכן שנמחק תוכן שנוסף
שורה 100:
# An array-based stack.
Stack
# An array storing the values.
1
# The current used size.
2
# Creates a stack.
Make-Stack()
1
# Note we're using the global variable max-size.
2
3
4
# Pushes (inserts) a value (v) to a stack (stk).
Push(stk, v)
1
שורה 125:
# (that has not yet been Pop()ed).
Pop(stk)
1
שורה 131:
# (that has not yet been Pop()ed).
Top(stk)
1
# Returns the number of values inside a stack (stk).
Size(stk)
1
===ניתוח===
|