May 2010
Intermediate to advanced
1272 pages
61h 18m
English
Stack CollectionThe System.Collections.Stack collection mimics the same-named memory area and works according to the LIFO (Last-In, First-Out) paradigm meaning that the last item you add to the collection is the first that is pulled out from the collection. Stack exposes three important methods: Push that adds an item to the collection, Pop that allows consuming and removing an item from the collection, and Peek that returns the top item in the collection without removing it. The following is an example:

As for Queue, here you work with Object items. Although this enables pushing different kinds of objects to the collection, it is not a good ...
Read now
Unlock full access