A.O(n2) B.O(n log2n) C.O(n) D.O(log2n)
单项选择题“在旅游时从某地出发要去某个目的地,如何选择线路才能使得路程最短”,从图的应用角度.最合理的解决方案是()
A.深度优先搜索 B.最小生成树 C.拓扑排序 D.最短路径
单项选择题已知含6个顶点(v0,v1,v2,v3,v4,v5)的无向图的邻接矩阵如题10图所示,则从顶点V0出发进行深度优先搜索可能得到的顶点访问序列为()
A.{v0,v1,v2,v5,v4,v3} B.{v0,v1,v2,v3,v4,v5} C.{v0,v1,v5,v2,v3,v4} D.{v0,v1,v4,v5,v2,v3}
单项选择题一个数组的第一个元素的存储地址是i00,每个元素占2个存储单元,则第5个元素的存储地址是()
A.120 B.110 C.108 D.100
单项选择题按层序(自顶向下、从左到右)遍历二叉树时需借助队列作辅助结构。对高度为3的满二叉树进行层序遍历时,队列中所出现的元素个数最多是()
A.1 B.2 C.3 D.4
单项选择题若采用顺序存储(一维数组)结构存储一棵如题7图所示的二叉树,根结点1的下标为l,剥结点4的下标为()
A.4 B.5 C.6 D.7
单项选择题设长度为n的队列用单循环链表表示(假设表尾结点为当前队列的队尾元素),若只设头指针,则入队操作、出队操作的时间复杂度分别为()
A.O(n)、O(1) B.O(1)、O(1) C.O(1)、O(n) D.O(n)、O(n)
单项选择题将递归形式描述的算法改写为功能等价的非递归形式描述的算法,通常应设置的辅助结构是()
A.顺序表 B.单链表 C.栈 D.队列
单项选择题设初始栈为空,s表示人栈操作,x表示出栈操作,则合法的操作序列是()
A.sxxssxxs B.ssxsxxxs C.ssxxxssx D.sssxxxsx
单项选择题将一个由指针q指向的结点插在单链表中由指针P所指向的结点之后的操作是()
A.p=q; B.p--:>next=q; C.q一>next=p--:>next;p-->next=q; D.p一>next—q;q-->next—p--:>next;
单项选择题计算n!(整数n≥0)的递归算法是:intFactorial(intn){if(n==o)returnl;elsereturnn*Factorial(n--1);}其时闯复杂度为()
A.O(n) B.O(log2n) C.O(n0) D.O(n2)
单项选择题一个公司的组织机构是1名公司经理领导若于名部门负责人、每个部门负责人领导若干名部门员工,则适合于描述该公司组织机构的逻辑结构是()
A.线性表 B.队列 C.树 D.图