错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

The Tournament

  • Paolo Ferragina,
  • Fabrizio Luccio

摘要

The problem of deciding the winner in a sport tournament is interpreted and coded as one of determining the maximum in a set of integers. Two solutions are compared, respectively based on performing a linear scan of the elements and on setting up a knockout stage among them. Remarkably, these two completely different strategies lead to algorithms of identical computational cost. The surprisingly nontrivial problem of finding the second largest element is also considered.