コード例 #1
0
ファイル: ChoPriorityQueue.cs プロジェクト: lanicon/Cinchoo
 /// <summary>Enqueues an item to the priority queue.</summary>
 /// <param name="priority">The priority of the object to be enqueued.</param>
 /// <param name="value">The object to be enqueued.</param>
 public virtual void Enqueue(int priority, object value)
 {
     _heap.Insert(priority, value);
 }
コード例 #2
0
 /// <summary>Adds an item to the heap.</summary>
 /// <param name="key">The key for this entry.</param>
 /// <param name="value">The value for this entry.</param>
 public override void Insert(IComparable key, object value)
 {
     lock (_heap.SyncRoot) _heap.Insert(key, value);
 }