Skip to main content

Posts

List in C#

The Collection classes are a group of classes designed specifically for grouping together objects and performing tasks on them. List class is a collection and defined in the System. Collections.Generic namespace and it provides the methods and properties like other Collection classes such as add, insert, remove, search etc. The C# List < T > class represents a strongly typed list of objects that can be accessed by index and it supports storing values of a specific type without casting to or from object. Referred from :- http://csharp.net-informations.com/collection/list.htm Download Code from below link :- https://app.box.com/s/kplszfmpooytythic1b29u85uhiffo9s Example :-  For calling this class method in void Main. Final output :-

Stack in C#

Stack is a LIFO collection. It provides a powerful and simple last-in-first-out data structure. This can help you develop parsers quickly and also replace complex recursive algorithms. Stack is a generic type. Types of Methods of Stack Pop() Removes and returns the object at the top of the System.Collections.Stack. Push() Inserts an object at the top of the System.Collections.Stack. Peek() Returns the object at the top of the System.Collections.Stack without removing it. Referred from :-  http://www.dotnetperls.com/stack Download Code from below link :- https://app.box.com/s/kplszfmpooytythic1b29u85uhiffo9s Example :-   For calling this class method in void Main.  Final output :-