宁波大学2019年《917数据结构与程序设计》考研专业课真题试卷

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

5000
10
A 7
A. C. 8n A. n2 C. n(n-1) 9 A C. 10
B.
C.
D.
B. D.
B. 2n D. 2n(n+1)
B.
D.
q
p
Dijkstra
qp
s
1
11
2019
(
917
150
5 ,5
25
1.
1 2 3 4 5 6,
2.
Prim
(A )
)
324651
3.
{100 28 6 72 130 54 180 110 138}
{
SLNode *q,*p= head->next;
head->next=NULL;
while(__ 2 __)
{
__ 3 __;
p=p->next;
__ 4 ____;
head->next=q;
}
}
3
typedef struct ArcNode{
int adjvex;
/*
*/
struct ArcNode *nextarc;
18
#include <stdio.h>
struct S { int a,b;
} data[2]={10,100,20,200}; int main() {
func(var1, var2+var3, var4,
var5)
A) 3
B) 4
C) 5
4
fseek(pFile 0L SEEK_CUR)
D) 6 SEEK_CUR
A)
B)
C)
D)
5
A)
B)
C)
D)
6
x
0
A)x%2= =1
B)x/2 C)x%2!=0
D)x%2= =0
7
a 10 a 0 C
A)a>=10 or a<=0 B)a>=0|a<=10 C)a>=10&&a<=0 D)a>=10||a<=0
2019
(
(A )
)
917
150
75
2 10
20
1
123456
A326145
B342165
C125346
D564231
2
A
B
C
D
3
()
A.
B. B-
C.
D.
4
n
i
Ai
B i+1
C n-i
D n-i+1
5
b,c,d,e,f,g,q,r,s,t
b
A f,c,b
B f,d,b
C g,c,b
D g,d,b
6
(
)
917
150
10
array
A) 4
B) 5
C) 6
D) 7
11
if
C
else
A)
if
B)
if
C)
else if
D)
1 if
12
A)do-while
B)do-while
break
C) do-while
while
D) do-while
while
13
int i,sum; for(i=1;i<=3;sum++)
C)
D)
6
11
(A )
2019
(
)
917
150
16
A) break
switch
B) continue
C) break
switch
D)
break
continue
17
A) int a[5]={0,1,2,3,4,5}; C) int a[N]={1,2,3} ;
B) int a[5]=5; D) int a[5]={3} ;
/*
*/
OtherInfo info;
/*
*/
} ArcNode;
typedef struct VertexNode{
VertexData
data;
ArcNode
*firstarc;
} VertexNode;
typedef struct{
VertexNode
vertex MAX-VERTEX-NUM ;
FindID(G, indegree); /* FindID
*/
InitStack(&S);
/*
*/
for(i=0; i<G.vexnum; i++)
if( 1
) Push(&S, i);
count=0; while(!StackEmpty(S))
{ Pop(&S, &i);
i .data);
count++;
p=G..vertex i .firstarc;
while(p! =NULL)
{
2
indegree k --;
if(indegree k ==0)
Push(&S, k);
3
} } /*while*/
if (count<G..vexnum) return(Error); /*
*/
else return(Ok); }
8 int x=1 y=6 z=2
x<z?y z
A)2
B)1
C)6
D)0
9
int a=20,b=30,c;
if(a>b)
c=a;
a=b;
b=a;
printf("a=%d,b=%d\n",a,b);
A a=30,b=300
D a=20,b=20
5
11
2019
if (R[ j ]
2
R[ k ] )
k=j;
if k!=i
{ temp=R[ i ]; R[ i ] = R[ k ]; R[ k ]=temp; }
}
}
}
2
11
2019
(
)
917
150
2
L,
converse
Struct SLNode {
DateType date;
1
;
};
void converse(SLNode * head)
28
4.
B-
5 B-
20 54 69 84 71 30 78 25 93 41 7 76
5.
6
11 9 13 15 29 23
6
2
18
1.
R[0] R[n-1]
void selectsort (int R[ ] ) { int i, j, k, temp ;
for (i=0; i<
1
; i++)
{ k=i ; for (j= i+1; j<=n-1; j++)
\
sum+=i;
A) 6
B) 3
C)
D) 0
14
int i,s=0; for(i=1;i<10;i+=2) printf("%d\n",s);
s+=i+1;
A)
1~9
B)
1~10
C)
1~9
D)
1~10
15
int x=23; do{
--); }while(!x);
A) 23 22 ... 1 B) 23
12
1.
4
2
n
ij
ij
Wij
n
?
8
(A )
4
11
2019
(
(A )
)
917
150
75
40
2
1
A)
B)
C)
D)
2
C
A) (x>=y>=z)
B) (x>=y) AND (y>=z)
C) (x>=y) && (y>=z)
D) (x>=y) & (y>=z)
3
var1, var2, var3, var4, var5 5
int vexnum, arcnum;
/*
*/
GraphKind
kind;
}AdjList;
(A )
3
11
2019
(
)
917
150
int TopoSort (AdjList G)
{ Stack S; int indegree MAX-VERTEX-NUM ;
int i, count, k; ArcNode *p;
相关文档
最新文档