Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace RG_Assessment3
  8. {
  9. class MyStack : IStackADT
  10. {
  11. //calling my variables
  12. private IntArrayList list1;
  13.  
  14.  
  15. //constructror
  16. public MyStack(IntArrayList list1)
  17. {
  18. this.list1 = new IntArrayList(20);
  19. }
  20.  
  21. public Boolean IsFull()
  22. {
  23. return list1.isFull();
  24. }
  25.  
  26. public void Display()
  27. {
  28. list1.display();
  29. }
  30.  
  31. public void push(int value)
  32. {
  33. list1.addFirst();
  34. }
  35.  
  36. public int pop()
  37. {
  38. return list1.removeLast();
  39. }
  40.  
  41. public Boolean isEmpty()
  42. {
  43. return list1.isEmpty();
  44. }
  45.  
  46. public int size()
  47. {
  48. return list1.size();
  49. }
  50.  
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement