第41302题 单选题
用下面的邻接表结构保存一个有向图 G,InfoType 和 VertexType 是定义好的类。设 G 有 n 个顶点、e 条弧,则求图 G 中某个顶点 u(其顶点序号为 k)的度的算法复杂度是( )。
class ArcNode:
    def __init__(self,adjvex=None,nextarc=None,info=None):
        self.adjvex = adjvex
        self.nextarc = nextarc
        self.info = info

class VNode:
    def __init__(self,data=None,firstarc=None):
        self.data = data
        self.firstarc = firstarc

class ALGraph:
    def __init__(self,vertices,vexnum,arcnum,kind):
        self.vertices = vertices
        self.vexnum, self.arcnum = vexnum, arcnum
        self.kind = kind

AdjList = [VNode() for i in range(MAX_VERTEX_NUM)]
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
知识点:
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析