.

C Sharp Collections Assignment Help

COLLECTIONS

  • It is a special className
  • It is mainly designed for data storing and retrieving
  • It supports stacks, queues, lists, hash tables
  • It actually implements common interfaces
  • It helps in dynamic memory allocation to an elements
  • It accesses a list of values based on an index
  • Object classNameis the base classNamefor all the classes
  • Here, it generates object collections of the classNameObject

The different Collection Classes

The System.Collection namespace has different common classNameusages


C Sharp Collections Assignment Help By Online Tutoring and Guided Sessions from assignmenthippo.com


ArrayList

  • It an another choice for an array (substitute)
  • It highlights an sequential collection of an object
  • Its are all indexed separately
  • Here elements can be added and eliminated from the list at a pointed position
  • It is achieved by means of an index
  • The array manipulates themself dynamically
  • It supports dynamic way of memory allocation
  • It also supports addition of an elements, sorting and searching elements in a list

Example

The below example depicts the usages of Arraylist in a program and its few methods

collections image 1

HashTable

  • It is a classNamewhich is perfectly organised
  • It represents set of value and key pairs
  • It organization works on the hash code of a key
  • To get the elements value in the collection list the key value is used
  • It is required to access values based on a key
  • It always comes in a key and value pair
  • It is impossible to access an item in a collection without a key
  • The key is employed to use the elements in the group.

Example

The following example shows how to use Hashtable  and its few methods

collections image 2

Sorted List

  • It depicts a set of key + value pairs
  • It is arranged in order based upon the  key value
  • It can be operated by key and an index value
  • It is a merge of array and hash table concepts
  • Using key or an index value elements list can be accessed
  • Using index accessing elements is an arraylist
  • Using key accessing elements is hashtable
  • But the elements are sorted only by the value of a key

Example

The below example showcases the usages of Sorted list and its methods  in a program

collections image 3
.