Retrieving the--stack stack queue hashtable hash table

Source: Internet
Author: User

            Stack advanced out without index            stack st = new stack ();            St. Push (n);            St. Push (one);            St. Push (+);            St. Push (a);            St. Push (56);//Insert 56 from the top of the stack should be at the upper Console.WriteLine of the Stack            (St. Peek ());//st. Peek (); Returns the top data of the stack without removing the            Console.WriteLine (St. Pop ());//st. Pop (); Remove and return the top data value of the stack            object[] arr1 = (object[]) St. ToArray ();//You can convert an array value from the top to the bottom of the            foreach (int i in arr1)            {                Console.Write (i + "");//traverse to one of the            }
   console.readline ();
            Queue FIFO            queue qu = new queue ();            Qu. Enqueue (12);//Add Data 12 should be qu at the beginning of the queue            . Enqueue ();            Qu. Enqueue (+);            Qu. Enqueue (+);            Console.WriteLine (Qu. Peek ());//qu. Peek (); Returns the object at the beginning without removing the            Console.WriteLine (qu. Dequeue ());//qu. Dequeue (); Returns the object at the beginning but removes  the            object[] arr2 = (object[]) qu. ToArray (); Convert an array value from the queue to the start            of the foreach (int i in arr2)            {                Console.Write (i + "");//traverse result is the "            console.read" Line ();

            Hashtable reads an array with key-value pairs, and can set its own index            Hashtable ht = new Hashtable ();            Ht. ADD (1, "Tiger");//any type of key key any type of value            ht. ADD (2, "lion");            Ht. ADD (3, "monkey");

Retrieving the--stack stack queue hashtable hash table

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.