C # hash table, queue, stack

Source: Internet
Author: User

Hash table

Does not specify the length, does not specify the type, does not specify the type of key

Hashtable ht = new Hashtable ();
Ht[' a '] = 1;
Ht[0] = "B";
Ht["B"] = ' C ';
HT[1] = "D";
Ht. ADD (1, "D");
HT[1] = "X";
foreach (Var x in HT. keys) keys, key value, value
{
Console.WriteLine (x);
}

Queue

Advanced First Out

Queue line = new Queue ();

Line. Enqueue ("");

Console.WriteLine (line. Dequeue ());

Stack

Advanced Post-out

Stack<string> st = new Stack<string> ();

St. Push ("");

Console.WriteLine (St. Pop ());

Class

Class lei{

puplic int i=1;

}

Structural body

struct jie{

puplic Int J;

}

Enumeration

Enum Week
{
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
}

struct instantiation
Lei L1 = new lei ();
Jie J1 = new Jie ();
l1.i = 2;
J1.J = 1;
Enum type
Week W1 = new Week ();

C # hash table, queue, stack

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.