西安电子科技大学算法试题答案.pdfVIP

  • 99
  • 0
  • 约7.29千字
  • 约 4页
  • 2020-01-21 发布于湖南
  • 举报
试题答案 A 卷 西安电子科技大学计算机学院霍红卫 Problem 1. (20 points) Solution: (a) Line 3 is executed n(n-1) times on any input of length n. Thus, the worst-case running time for BUBBLE-SORT is Θ(n2) since there are 6 lines and each line is executed at most n(n-1) times. (b) Line 3 is also executed n(n-1) times in the best case, since it is executed this many times on any input of length n. Thus, the best-case running time

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档