1 / 4

The main primitives of a stack are known as: Push adds a new node Pop removes a node Additional primitives can be defi

The main primitives of a stack are known as: Push adds a new node Pop removes a node Additional primitives can be defined: IsEmpty reports whether the stack is empty IsFull reports whether the stack is full Initialise creates/initialises the stack

jessie
Download Presentation

The main primitives of a stack are known as: Push adds a new node Pop removes a node Additional primitives can be defi

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The main primitives of a stack are known as: Push adds a new node Pop removes a node Additional primitives can be defined: IsEmpty reports whether the stack is empty IsFull reports whether the stack is full Initialise creates/initialises the stack Destroy deletes the contents of the stack (may be implemented by re-initialising the stack) Initialise Creates the structure – i.e. ensures that the structure exists but contains no elements

  2. e.g. Initialise(S) creates a new empty stack named S S

  3. Push e.g. Push(X,S) adds the value X to the TOP of stack S S

  4. Pop e.g. Pop(S) removes the TOP node and returns its value S

More Related