Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package stack_withLL;
- class node{
- protected int data;
- protected node link;
- public node(){
- data = 0;
- link = null;
- }
- public node(int v, node n){
- data = v;
- link = n;
- }
- /* Function to get link to next node */
- public node getLink()
- {
- return link;
- }
- /* Function to get data from current Node */
- public int getData()
- {
- return data;
- }
- }
- public class linked_stack {
- protected node top;
- protected int size;
- }
Add Comment
Please, Sign In to add comment