题目详情

对n个关键码构成的序列采用简单选择排序法进行排序的过程是:第一趟经过n-1次关键码之间的比较,确定出最小关键码在序列中的位置后,再将其与序列的第一个关键码进行交换,第二趟则在其余的n-1个关键码中进行n-2次比较,确定出最小关键码的位置后,再将其与序列的第二个关键码进行交换……以此类推,直到序列的关键码从小到大有序排列。在简单选择排序过程中,关键码之间的总比较次数为(  )。

  • A.n(n-1)/2
  • B.<img src='http://tp.mxqe.com/data/718/17975787_0.png' alt='中级软件评测师,历年真题,2019年下半年(上午)《软件评测师》真题' title='中级软件评测师,历年真题,2019年下半年(上午)《软件评测师》真题'>
  • C.n(n+1)/2
  • D.nlogn

正确答案及解析

正确答案
A
解析

依据题干的描述完成第1趟排序比较次数为n-1;第2趟为n-2次比较;以此类推;所以总的比较次数为:(n-1)+(n-2)+……+1=n(n-1)/2

包含此试题的试卷

你可能感兴趣的试题

单选题

Advancements in ( )have contributed to the growth of the automotive industry through the creation and evolution of self-driving vehicles.

  • A.Artificial Intelligence
  • B.Cloud Computing
  • C.Internet of Things
  • D.Big Data
查看答案
单选题

In project human resource management , ( )is not a source of power for the project manager.

  • A.referent power
  • B.expert power
  • C.reward power
  • D.audit power
查看答案
单选题

At the project establishment stage , the feasibility study mainly includes techinical feasibility analysis , ( ), operation environment feasibility analysis and other aspects of feasibility analysis.

  • A.detail feasibility analysis
  • B.opportunity analysis
  • C.economic feasibility analysis
  • D.risk analysis
查看答案
单选题

( )is a grid that shows the project resources assigned to each work package.

  • A.Stakeholder engagement assessment matrix
  • B.Requirements traceability matrix
  • C.Probability and impact matrix
  • D.Responsibility assignment matrix
查看答案
单选题

Xinhua News Agency reported in January 2022,Chian will further promote the developmet of a digital economy during the 14th Five-Year Plan eriod(2021-2025). The plan also emphasized industrial ( )transformation.

  • A.digital
  • B.networking
  • C.intelligentize
  • D.informatization
查看答案

相关题库更多 +