2014-07-10から1日間の記事一覧

C# よく使いそうなコード3

C#

プライオリティキュー 以下の名前空間を定義 using System.Collections.Generic; 例 SortedSet<string> test = new SortedSet<string> (); test.Add ("b"); test.Add ("c"); test.Add ("a"); test.Add ("g"); Console.WriteLine ("Max = " + test.Max.ToString ()); Console.</string></string>…

C# よく使いそうなコード2

C#

スタック 以下の名前空間を定義 using System.Collections.Generic; 例 Stack<string> test = new Stack<string> (); test.Push("one"); test.Push("two"); Console.WriteLine(test.Pop()); Console.WriteLine(test.Pop()); 使えそうなメソッド ・Pop 先頭にあるオブジェクト</string></string>…