Write My Paper Button

WhatsApp Widget

System. Collections. Generic | My Assignment Tutor

Program in C# to demonstrate the different operations on Stack usingfixed array.using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Stack{class Stack{private int[] ele;private int top;private int max;public Stack(int size){ele = new int[size];//Maximum size of Stacktop = -1;max = size;}public void push(int item){if (top == max – 1){Console.WriteLine(“Stack Overflow”);return;}else{ele[++top] = item;}}public int pop(){if (top == -1){Console.WriteLine(“Stack is Empty”);return … Continue reading “System. Collections. Generic | My Assignment Tutor”

Program in C# to demonstrate the different operations on Stack usingfixed array.using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Stack{class Stack{private int[] ele;private int top;private int max;public Stack(int size){ele = new int[size];//Maximum size of Stacktop = -1;max = size;}public void push(int item){if (top == max – 1){Console.WriteLine(“Stack Overflow”);return;}else{ele[++top] = item;}}public int pop(){if (top == -1){Console.WriteLine(“Stack is Empty”);return -1;}else{Console.WriteLine(“{0} popped from stack “, ele[top]);return ele[top–];}}public int size(){if (top == -1){Console.WriteLine(“Stack is Empty”);}else{Console.WriteLine(“Number of elements on the stack is “, top);}return -1;}public void capacity(){Console.WriteLine(“Total capacity of stack is {0}”, max);}public void printStack(){if (top == -1){Console.WriteLine(“Stack is Empty”);return;}else{for (int i = 0; i

Don`t copy text!
WeCreativez WhatsApp Support
Our customer support team is here to answer your questions. Ask us anything!
???? Hi, how can I help?