コード例 #1
0
ファイル: BinaryHeap.cs プロジェクト: blaquee/helion-proxy
 /// <summary>Ensures that heap is wrapped in a synchronous wrapper.</summary>
 /// <param name="heap">The heap to be wrapped.</param>
 /// <returns>A synchronized wrapper for the heap.</returns>
 public static BinaryHeap Synchronize(BinaryHeap heap)
 {
     // Create a synchronization wrapper around the heap and return it.
     if (heap is SyncBinaryHeap) return heap;
     return new SyncBinaryHeap(heap);
 }
コード例 #2
0
ファイル: BinaryHeap.cs プロジェクト: blaquee/helion-proxy
 /// <summary>Initialize the heap with another heap.</summary>
 /// <param name="heap">The heap on which to perform a shallow-copy.</param>
 public BinaryHeap(BinaryHeap heap)
 {
     // Clone the list (the only state we have)
     _list = (ArrayList)heap._list.Clone();
 }
コード例 #3
0
ファイル: PriorityQueue.cs プロジェクト: codingday/codeweb
 /// <summary>Initialize the queue.</summary>
 /// <param name="queue">The queue is intialized with a shalled-copy of this queue.</param>
 public PriorityQueue(PriorityQueue queue)
 {
     _heap = queue._heap.Clone();
 }
コード例 #4
0
ファイル: BinaryHeap.cs プロジェクト: blaquee/helion-proxy
 /// <summary>Initialize the synchronized heap.</summary>
 /// <param name="heap">The heap to synchronize.</param>
 internal SyncBinaryHeap(BinaryHeap heap)
 {
     _heap = heap;
 }
コード例 #5
0
ファイル: PriorityQueue.cs プロジェクト: codingday/codeweb
 /// <summary>Initialize the queue.</summary>
 public PriorityQueue()
 {
     _heap = new BinaryHeap();
 }