コード例 #1
0
 public PriorityQueue(T root, Comparison <T> comparison)
 {
     stack = new StackByResizeableArray <T>();
     stack.Push(default);
コード例 #2
0
 StackByResizeableArray <int> stack;// where the data is stored
 //Left child of stack[i]: stack[2*i]
 //Right child of stack[i]: stack[2*i+1]
 BinaryHeap(int root)
 {
     stack = new StackByResizeableArray <int>();
     stack.Push(0);
     stack.Push(root);
 }