using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Collections.Generic;
namespace Project2
{
struct Pair
{
public int key;
public double value;
}
class PriorityQueue
{
private SortedList<int,double> PseudoQueue;
private double value;
private int key;
public int Key
{
get
{
return key;
}
}
public double Value
{
get
{
return value;
}
}
public bool Empty
{
get
{
return PseudoQueue.Count == 0;
}
}
public PriorityQueue()
{
PseudoQueue = new SortedList<int,double>();
}
public void push(int key, double Value)
{
PseudoQueue.Add(key, Value);
}
public void pop()
{
key = PseudoQueue.Keys.ElementAt(0);
value = PseudoQueue[key];
PseudoQueue.Remove(key);
}
public int GetCount()
{
return PseudoQueue.Count;
}
}
class Program
{
static void Main(string[] args)
{
PriorityQueue prior = new PriorityQueue();
prior.push(1, 2.0);
prior.push(10, 3.0);
prior.push(41, 4.0);
prior.push(12, 5.0);
prior.pop();
Console.WriteLine("key->{0} value->{1}", prior.Key,prior.Value);
prior.pop();
Console.WriteLine("key->{0} velue->{1}", prior.Key, prior.Value);
prior.pop();
Console.WriteLine("key->{0} velue->{1}", prior.Key, prior.Value);
prior.pop();
Console.WriteLine("key->{0} velue->{1}", prior.Key, prior.Value);
Console.ReadKey();
}
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}