Question: = void CopyStack(StackNodeT * & stack, StackNodeT * other) { StackNodeT * trace; StackNodeT * tmp; StackNodeT * head; stack = nullptr; head = nullptr;

= void CopyStack(StackNodeT * & stack, StackNodeT * other) { StackNodeT * trace; StackNodeT * tmp; StackNodeT * head; stack = nullptr; head = nullptr; trace = other; while (trace != nullptr) { tmp = new StackNodeT; tmp->next = nullptr; tmp->data = trace->data; if (stack nullptr) { stack = tmp; head stack; } else { head->next tmp; stack = tmp; } trace = trace ->next; stack = head; } StackT:: StackT(const StackT & other) { CopyStack (stack, other.stack); size = other.size; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!