Microsoft Visual C# 2013 Step by Step

Microsoft Visual C# 2013 Step by Step

Author:John Sharp
Language: eng
Format: epub
Tags: COMPUTERS / Programming Languages / C#
ISBN: 9780735681828
Publisher: Microsoft Press
Published: 2013-11-13T16:00:00+00:00


Populating the queue: 9 has joined the queue 3 has joined the queue 7 has joined the queue 2 has joined the queue The queue contains the following items: 9 3 7 2 Draining the queue: 9 has left the queue 3 has left the queue 7 has left the queue 2 has left the queue

The Stack<T> collection class

The Stack<T> class implements a last-in, first-out mechanism. An element joins the stack at the top (the push operation) and leaves the stack at the top (the pop operation). To visualize this, think of a stack of dishes: new dishes are added to the top and dishes are removed from the top, making the last dish to be placed on the stack the first one to be removed. (The dish at the bottom is rarely used and will inevitably require washing before you can put any food on it, because it will be covered in grime!) Here’s an example—notice the order in which the items are listed by the foreach loop:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.