------------This function displys the contents of stack 1---------------------------------*/
| 64 | |
| 65 | /*------------This function displys the contents of stack 1---------------------------------*/ |
| 66 | void display_1(){ |
| 67 | if(top_1 == -1){ |
| 68 | cout << "Stack empty" << endl; |
| 69 | return; |
| 70 | } |
| 71 | |
| 72 | cout << "The Stack 1 elements are : "; |
| 73 | |
| 74 | for(int i = top_1; i > 0; i--) |
| 75 | cout << arr[i] << " ---> "; |
| 76 | cout << arr[0] << endl; |
| 77 | } |
| 78 | |
| 79 | |
| 80 | /*------------This function displays the contents of stack 2--------------------------------*/ |