0% found this document useful (0 votes)
3 views3 pages

Stack Swap Function Explained

The document describes a function for swapping the contents of two stacks of the same type, regardless of their size differences. It notes that elements in a stack are printed in reverse order, starting from the top. This is important for understanding how the swap operation will display the contents.

Uploaded by

theneweltaweel
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Stack Swap Function Explained

The document describes a function for swapping the contents of two stacks of the same type, regardless of their size differences. It notes that elements in a stack are printed in reverse order, starting from the top. This is important for understanding how the swap operation will display the contents.

Uploaded by

theneweltaweel
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Swap Stack

!! This function is used to swap the contents of one stack with another stack of the same type but the size
may vary.

!! Note: In stack container, the elements are printed in reverse order because the top is printed first then
moving on to other elements.

You might also like