kunkunwoo@blog:~$ 거누권의 생각깜지

c#에서의 queue의 push, pop, front

· 배운 것 · 1분 읽기

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization.Formatters.Binary;
using System.Threading;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Queue<int> q = new Queue<int>();
            q.Enqueue(100);	//push
            q.Enqueue(120);
            q.Enqueue(130);
            q.Peek(); // front
            int next = q.Dequeue();//100 // pop 개꿀인게 return형이 있어 c++보다 편함
            next = q.Dequeue();//120
        }
    }
}