Example #1
0
 internal Enumerator(HeapMap <TKey, TValue> map, int getEnumeratorRetType)
 {
     this.map = map;
     index    = 0;
     this.getEnumeratorRetType = getEnumeratorRetType;
     current = new KeyValuePair <TKey, TValue> ();
 }
Example #2
0
 internal Enumerator(HeapMap <TKey, TValue> map)
 {
     this.map   = map;
     index      = 0;
     version    = map.version;
     currentKey = default(TValue);
 }
Example #3
0
 public KeyCollection(HeapMap <TKey, TValue> map)
 {
     if (map == null)
     {
         throw new ArgumentNullException();
     }
     this.map = map;
 }
Example #4
0
    public static void Main(string[] args)
    {
        HeapMap <string> pq = new HeapMap <string>();

        pq.Enqueue("Bob", 5);
        pq.Enqueue("Rob", 10);
        pq.Enqueue("Mike", 6);
        pq.Enqueue("Tina", 3);
        pq.Enqueue("Andy", 2);
        pq.Enqueue("Judy", 9);

        pq.UpdatePriority("Tina", 10);
        pq.UpdatePriority("Rob", 5);

        int ct = 6;

        while (ct > 0)
        {
            Console.WriteLine(pq.Dequeue());
            ct--;
        }
        Console.WriteLine();
    }
Example #5
0
 internal Enumerator(HeapMap <TKey, TValue> map)
 {
     this.map   = map;
     index      = 0;
     currentKey = default(TKey);
 }