void Update(Woman mother) { Woman temp; int i = getNameIndex(mother.name); temp = A.get(i); temp.dilation = A.get(i).dilation + mother.dilation; temp.name = A.get(i).name; temp.order = A.get(i).order; A.set(i, temp); shiftUp(i); shiftDown(i); }
void Insert(Woman mother) { BinaryHeapSize++; binaryHeapOrder++; mother.order = binaryHeapOrder; B.put(mother.name, mother); if (BinaryHeapSize >= A.size()) { A.add(mother); } else { A.set(BinaryHeapSize, mother); } shiftUp(BinaryHeapSize); }