Google Ads

Sunday, September 13, 2009

STACK using Linked List



Representation of STACK using Linked List



Algorithm:


Step 1: Create a structure with data and Link field

Step 2: Allocate the memory for the new node

Step 3: Insert the value into the new node using PUSH operation

Step 4: Release the allocated memory for deleting the item from the structure

Step 5: Create a function to retrieve the contents from the Top of the Stack

Step 6: Create a function for display the items from the stack.

Step 7: Create a function for Is Empty condition

Step 8: Create a function for Is Full condition.

Step 9: Create a function to count the number of nodes in the stack.

Step 10 : Stop the execution.

No comments:

Post a Comment