题目详情

设某无向图的顶点个数为n,则该图最多()条边;若将该图用邻接矩阵存储,则矩阵的行数和列数分别为(43)。

  • A.n、n
  • B.n、n-1
  • C.n-1、n
  • D.n+1、n

正确答案及解析

正确答案
A
解析

本题考查数据结构基础知识。

对于有n个顶点的无向图,每个顶点与其余的n-1个顶点都可以有1条边,对于每一对不同的顶点v与w,边(v,w)与(w,v)是同一条,因此该图最多有n*(n-1)/2条边。

图采用邻接矩阵存储时,矩阵的每一行对应一个顶点,每一列对应一个顶点,所以矩阵是个n阶方阵。

你可能感兴趣的试题

单选题

(  )is the process of transforming information so it is unintelligible to anyone but the intended recipient.

  • A.Encryption
  • B.Decryption
  • C.Security
  • D.Protection
查看答案
单选题

As each application module is completed,it undergoes(  )to ensure that it operates correctly and reliably.

  • A.unit testing
  • B.integration testing
  • C.system testing
  • D.acceptance testing
查看答案
单选题

(  )algorithm specifies the way to arrange data in a particular order.

  • A.Search
  • B.Random
  • C.Sorting
  • D.Merge
查看答案
单选题

After analyzing the source code,(  )generates machine instructions that will carry out the meaning of the program at a later time.

  • A.an interpreter
  • B.a linker
  • C.a compiler
  • D.a converter
查看答案
单选题

(  )can help organizations to better understand the information contained within the data and will also help identify the data that is most important to the business and future business decisions.

  • A.Data processing system
  • B.Big Data analytics
  • C.Cloud computing
  • D.Database management
查看答案

相关题库更多 +