akosiraff

Linked List Stack C++

Apr 1st, 2013
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/linked-list-stack-c/
  3. Download the file linkedStack.zip. Modify the driver.cpp file by implementing the function called reverseStack() that will reverse the contents from a given stack and place the results back in the original stack. This function only takes a stack variable as parameter. The function can use an additional local temporary stack for processing. The prototype for this function appears as follows:
  4. template
  5. void transferStack(linkedStackType& stack);
  6. Note: Again, you only need to modify the driver.cpp file by adding the necessary code to implement the TODO areas as noted in the comments. The prototype for the function and everything else in the program will remain the same. Review the printStack() function as an example on how to create a while-loop and how use an temporary stack for this function.
  7. Output: The output for the program after the function is implemented should appear as follows:
  8. Stack:
  9. 262 115 74 26 34 243 22 734 113 121
  10. Stack Reversed:
  11. 121 113 734 22 243 34 26 74 115 262
  12. ** Press any key to continue **
  13.  
  14. Download: http://solutionzip.com/downloads/linked-list-stack-c/
Advertisement
Add Comment
Please, Sign In to add comment