Using what was given in question 2a, write the complete push…

Using what was given in question 2a, write the complete push method.  Use the return value (a boolean) to denote whether the push operation was successful (true) or unsuccessful (false).  Note:  The method should not be more than a few lines. public bool push (int  item) {

Assume that you have the following partial class definition…

Assume that you have the following partial class definition for a user stack of integers. class MyStack {   private  int sp = -1;          //instance variables   private int  A[10];     public bool push (int  item){    //  code body would go here    }   public int pop ( ) {   // code body would go here  }   For each of the following six operations, give the value of sp and the value of A[sp] after the operation has completed.  Additionally, if anything has been returned, list what the returned value is. push (5),  push (7),  value1 = pop (), push (33), value2 = pop();   value3 = pop()

Consider the following class: class IntNode {     private i…

Consider the following class: class IntNode {     private int data;          // data stored in node     private IntNode link;  // reference to another node   Complete the following constructor following the specifications given in lecture: public IntNode (int initialData)                                                {        }