Linked List Stack

Download Category:

linkedStack.zip - (4.8 MB)
[
linkedStack/Debug/
linkedStack/Debug/cl.command.1.tlog
linkedStack/Debug/CL.read.1.tlog
linkedStack/Debug/CL.write.1.tlog
linkedStack/Debug/Driver.obj
linkedStack/Debug/link.command.1.tlog
linkedStack/Debug/link.read.1.tlog
linkedStack/Debug/link.write.1.tlog
linkedStack/Debug/linkedStack.exe
linkedStack/Debug/linkedStack.exe.intermediate.manifest
linkedStack/Debug/linkedStack.ilk
linkedStack/Debug/linkedStack.lastbuildstate
linkedStack/Debug/linkedStack.log
linkedStack/Debug/linkedStack.pdb
linkedStack/Debug/mt.command.1.tlog
linkedStack/Debug/mt.read.1.tlog
linkedStack/Debug/mt.write.1.tlog
linkedStack/Debug/vc100.idb
linkedStack/Debug/vc100.pdb
linkedStack/Driver.cpp
linkedStack/ipch/
linkedStack/ipch/linkedstack-afbfd786/
linkedStack/ipch/linkedstack-afbfd786/linkedstack-9de60699.ipch
linkedStack/linkedStack.h
linkedStack/linkedStack.sdf
linkedStack/linkedStack.sln
linkedStack/linkedStack.suo
linkedStack/linkedStack.vcxproj
linkedStack/linkedStack.vcxproj.filters
linkedStack/linkedStack.vcxproj.user
linkedStack/Screenshot.JPG
]

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:

template

void transferStack(linkedStackType& stack);

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.

Output: The output for the program after the function is implemented should appear as follows:

Stack:

262 115 74 26 34 243 22 734 113 121

Stack Reversed:

121 113 734 22 243 34 26 74 115 262

** Press any key to continue **

Write a Review

Get a fresh solution of this question. Ask it now to our experts.
doubt

Ask Your Question

We have verified professionals who are ready to answer your question.

time

Save Time and Money

We choose experts who can quickly answer your question and that suit your budget.

download

Get Your Answer

Your satisfaction is 100% guaranteed. You can keep on asking questions until you get the answer you need.