static void test(IMaxPQ <string> pq) { Console.WriteLine(pq.ToString()); pq.Insert("this"); pq.Insert("is"); pq.Insert("a"); pq.Insert("test"); while (!pq.IsEmpty()) { Console.Write(pq.DelMax() + " "); } Console.WriteLine(); }
static long test(IMaxPQ <char> pq) { var sw = new Stopwatch(); sw.Restart(); var input = "P R I O * R * * I * T * Y * * * Q U E * * * U * E"; foreach (var c in input) { if (c == ' ') { continue; } else if (c == '*') { pq.DelMax(); } else { pq.Insert(c); } } sw.Stop(); return(sw.ElapsedMilliseconds); }