morry2341

LinkedStack_Part2

Oct 29th, 2022
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.IO;
  5. using System.Net;
  6. using System.Linq;
  7.  
  8. namespace ConsoleApp1
  9. {
  10.     static class Program
  11.     {
  12.        
  13.         static void Main(string[] args)
  14.         {
  15.             StackedLinkedList list = new StackedLinkedList();
  16.             list.push(11);
  17.             list.push(22);
  18.             list.push(33);
  19.             list.push(44);
  20.  
  21.             list.display();
  22.            
  23.             Console.Write("\nTop element is {0}\n", list.peek());
  24.  
  25.             list.pop();
  26.             list.pop();
  27.  
  28.             list.display();
  29.            
  30.             Console.Write("\nTop element is {0}\n", list.peek());
  31.  
  32.  
  33.  
  34.         }
  35.        
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment