CodePudding user response:
With an auxiliary stackCodePudding user response:
End in good solve: as long as the record inserted value is biggest, is a record is updated, not, just keep the original maximum;Delete at one end is not good solution: if you remove the just right is one of the biggest, the remaining elements which is the biggest? Didn't know it,
Can think of is separate to make an order queue, insert and delete all synchronous update this queue,