Friday 10, February 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    Forum    |    About Us    |    Contact Us

Stacks

A stack is a list of elements in which an element may be inserted or deleted only at one end called the top of the stack. This means, in particular that elements are removed from a stack in the reverse ordered of that in which they were inserted into the stack.

Special terminologies:

Push is the term used to insert an element into the stack.
Pop is the term used to delete an element from the stack.

Adding an Item Into Stack:

procedure push(item : items);
{add item to the global stack stack;
top is the current top of stack
and n is its maximum size}
begin
    if top = n then OverFlow;
    top := top+1;
    stack(top) := item;
end: {of add}

Deleting an Item From Stack:
procedure pop(item : items);
{remove top element from the stack stack and put it in the item}
begin
    if top = 0 then UnderFlow;
    item := stack(top);
    top := top-1;
end; {of delete}

 
     
   
Data Structure Theory Tutorial
 
  Data Structure
Data Structure
  Abstract Data Types
Abstract Data Types
  Stacks
Stacks
  Queues
Queues
  Linked Lists
Linked Lists
  Linear Search
Linear Search
  Sorting
Sorting
  Hashing
Hashing
  Trees
Trees
  Graphs
Graphs
 
 
 
Web Designing Tutorials
  HTML Tutorial
HTML Tutorial
  DHTML Tutorial
DHTML  Tutorial
  CSS Tutorial
CSS Tutorial
  XHTML Tutorial
XHTML Tutorial
 
Programming Languages Tutorials
  C Language Tutorial
C Language Tutorial
  C++ Tutorial
C++ Tutorial
  Java Language Tutorial
Java Language Tutorial
  Data Structure Theory Tutorial
Data Structure Theory Tutorial
 
Server Side Scripting Tutorials
  PHP Tutorial
PHP Tutorial
  SQL Tutorial
SQL Tutorial
  ASP Tutorial
ASP Tutorial
 
Client Side Scripting Tutorials
  JavaScript Tutorial
JavaScript Tutorial
  VBScript Tutorial
VBScript Tutorial
 
 
 
POPULAR E-BOOKS
 
Download How to Pick a Shopping Cart System that Makes You Money  Ebook How to Pick a Shopping Cart System that Makes You Money
   
Download Building Texts Faster Ebook Building Texts Faster
   
Download Ajax Design Patterns  Ebook Ajax Design Patterns
   
Download Freelancing for Fun and Profit Ebook Freelancing for Fun and Profit
   
Download 	C Elements of Style Ebook C Elements of Style
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz