10.7 The Ballot-based Algorithm