CS301 Assignment 1 Complete Solution 2017
CS301 Assignment No 01 Solution Fall 2017
Write a C++ program to balance three (3) stacks so the sum of numbers in each stack should be same.
Your program should fulfill following requirements.
- Create three (3) stacks, initially each stack will have three same numbers. Number of each stack should be different from other stack numbers. You can see in above diagram that initially each stack have same number but number is different from the numbers in other stacks.
- Your program should swap values between stack in the way that after balancing the stacks. Each stack should have different number as showing in above diagram.
- Please note that user will enter numbers into stack, not X, Y and Z.
- User will enter a number for each stack which will be inserted 3 times in each stack.
- You can implement stack through array or link list. It is your choice.
Sample output screen shot of program is given below
- First understand the code given in handouts about stack.
- Don’t allow popping if stack is empty and pushing if stack is full.
You can download the CS301 Data Structures Assignment 1 Solution file from here