数据结构(全英文)智慧树知到期末考试答案2024年_第1页
数据结构(全英文)智慧树知到期末考试答案2024年_第2页
数据结构(全英文)智慧树知到期末考试答案2024年_第3页
免费预览已结束,剩余4页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

数据结构(全英文)智慧树知到期末考试答案2024年数据结构(全英文)Consider

the

following

definition

in

C

programming

languagestruct

node

{

int

data;

struct

node

*

next;}typedef

struct

node

NODE;NODE

*ptr;Which

of

the

following

c

code

is

used

to

create

new

node?(

)

A:ptr=(NODE*)malloc(sizeof(NODE));B:malloc(sizeof(NODE));C:ptr=(NODD:ptr=(NODE*)malloc(NODE);E:ptr=(NODE*)malloc(sizeof(NODE*));答案:ptr=(NODE*)malloc(sizeof(NODE));26.

Identify

the

recursive

expression

to

obtain

the

nth

Fibonacci

number

using

recursion.

(

)

A:fib(n)=fib(n+1)+fib(n+2)B:fib(n-1)=fib(n)+fib(n+1)C:fib(n+1)=fib(n)+fib(n-1)D:fib(n)=fib(n-1)+fib(n-2)答案:bConsider

the

following

C

code,

where

stack

is

implemented

using

the

array.#define

MAX

10struct

STACK

{

int

arr[MAX]

int

top

=

-1;}In

this

implementation

of

stack,

maximum

value

of

top

which

cannot

cause

overflow

will(

)

A:-1B:9C:1D:10答案:945.

If

there

are

n

non-zero

terms

in

a

polynomial,

the

size

of

the

array

required

would

be________.(

)

A:2n-1B:2n+1C:nD:2n答案:n39.

In

the

polynomial,

A(x)=

x4+10x3+3x2+1,

what

is

(coefficient,

exponent)

pair

of

last

term?

(

)

A:(0,1)B:(1,4)C:(4,1)D:(1,0)答案:(1,0)Deletion

of

an

element

from

the

array

reduces

the

size

of

array

by

(

)

A:oneB:threeC:zeroD:two答案:oneA

normal

queue,

if

implemented

using

an

array

of

size

MAX_SIZE

in

C,

gets

full

when(

)

A:front=rear+1B:rear=MAX_SIZE-1C:rear=frontD:front=(rear+1)mod

MAX_SIZE答案:rear=MAX_SIZE-1Nodes

that

have

degree

zero

are

called

________nodes.(

)

A:childB:non-terminalC:rootD:leaf答案:leafIf

the

elements

“A”,

“B”,

“C”

and

“D”

are

placed

in

a

queue

and

are

deleted

one

at

a

time,

in

what

order

will

they

be

removed(

)

A:ABDCB:DCBAC:DCABD:ABCD答案:ABCDArray

which

is

having

____________

dimensions

is

called

as

2-D

array.(

)

A:4B:3C:1D:2答案:2If

we

have

declared

an

array

as

int

arr[6];

then

which

of

the

following

array

element

is

considered

as

last

array

element

in

C?(

)

A:arr[0]B:arr[5]C:arr[6]D:arr[4]答案:arr[5]If

the

elements

“A”,

“B”,

“C”

and

“D”

are

placed

in

a

stack

and

are

deleted

one

at

a

time,

in

what

order

will

they

be

removed?(

)

A:DCABB:ABCDC:ABDCD:DCBA答案:DCBAWhat

data

structure

would

you

mostly

likely

see

in

implementation

of

a

recursive

algorithm?(

)

A:QueueB:TreeC:ArrayD:Stack答案:StackChildren

of

the

same

parent

said

to

be______nodes.(

)

A:rootB:childC:siblingD:leaf答案:siblingIf

we

store

the

nodes

of

a

binary

tree

in

an

array

with

index

starting

from

zero,

if

the

leftchild

is

at

index

n,

its

right

brother

at(

)

A:2n+2B:(n-1)/2C:2n+1D:n+1

答案:2n+1User

perform

following

operations

on

stack

of

size

five

:

push(1);pop();push(2);push(3);pop();push(4);pop();pop();push(5);

at

the

end

of

last

operation,

total

number

of

elements

present

in

the

stack

are(

)

A:D.1B:A.3C:C.2D:B.4答案:D.1Whatwouldbetheasymptotictimecomplexitytofindanelementinthelinkedlist?

A:NoneB:O(n)C:O(n²)D:O(1)答案:O(n)A

variant

of

linked

list

in

which

last

node

of

the

list

points

to

the

first

node

of

the

list

is?(

)

A:Multiply

linked

listB:Singly

linked

listC:Circular

linked

listD:Doubly

linked

list答案:AI参考:答案:C:Circularlinkedlist\n\n解释:题目中描述的是一个链表结构,其中最后一个节点指向第一个节点,这种结构被称为循环链表(Circularlinkedlist)。其他选项中,单链表(Singlylinkedlist)的最后一个节点不指向第一个节点,双链表(Doublylinkedlist)的最后一个节点指向下一个节点而不是指向第一个节点,而多链表(Avariantoflinkedlist)没有明确描述最后一个节点指向第一个节点的结构。因此,正确答案是C。'26.

Identify

the

recursive

expression

to

obtain

the

nth

Fibonacci

number

using

recursion.

(

)

A:fib(n)=fib(n+1)+fib(n+2)B:fib(n-1)=fib(n)+fib(n+1)C:fib(n+1)=fib(n)+fib(n-1)D:fib(n)=fib(n-1)+fib(n-2)答案:AI参考:正确答案是D:fib(n)=fib(n-1)+fib(n-2)。\n根据斐波那契数列的定义,每个数字是前两个数字的和,因此可以使用递归表达式fib(n)=fib(n-1)+fib(n-2)来计算第n个斐波那契数。选项D是正确的递归表达式。'In

algorithm

which

converts

infix

expression

to

postfix

expression.

the

ICP

stands

for(

)

A:In-Coming

PriorityB:Inside-Count

PriorityC:In-Count

Primary

D:None

of

the

above答案:AI参考:题目中的空格部分应填入一个关于某种算法或程序部分的名称,这个算法或程序负责将infix表达式转换为postfix表达式。而选项A的“In-ComingPriority”与题目描述不符,选项B的“Inside-CountPriority”和选项C的“In-CountPrimary”虽然可能与某种特定的算法或程序有关,但并不能从题目描述中直接得出。因此,选项D“Noneoftheabove”是正确的答案。\n\n所以,正确选项是【D:Noneoftheabove】。'45.

If

there

are

n

non-zero

terms

in

a

polynomial,

the

size

of

the

array

required

would

be________.(

)

A:2n-1B:2n+1C:nD:2n答案:AI参考:正确答案是D:2n。\n多项式中如果有n个非零项,那么需要的数组大小为(n+1)×(n-1)/2,即2n。因此选项D为正确答案。'24.

A

function

which

calls

itself

is

called

as

______function.(

)

A:recursiveB:iterativeC:staticD:dynamic答案:AI参考:正确答案是A:recursive(递归的)。\n递归函数是指一个函数直接或间接调用自身,所以选项A“recursive”是正确答案。选项B“iterative”(迭代的)描述的是重复的过程,与递归不符;选项C“static”(静态的)和选项D“dynamic”(动态的)描述的是其他性质,与本题无关。'In

the

stack,

if

user

try

to

remove

element

from

the

empty

stack

then

it

called

as

(

)

A:garbageB:underflowC:emptyD:overflow答案:AI参考:在堆栈中,如果用户尝试从空堆栈中删除元素,那么这被称为“下溢”。因此,正确答案是B:underflow。'66.

If

an

algorithm

include

two

for

(or

while)

loops,

the

time

complexity

of

algorithm

may

become________.(

)

A:constantB:linear.C:logarithmic.D:quadratic答案:AI参考:答案:D\n推理过程:算法包含两个for(或while)循环,其时间复杂度可能会变为二次的。因此,选项D为正确答案。\n\n解释:时间复杂度是用来衡量算法执行时间的一个指标,它通常用算法执行次数与输入规模之间的关系来描述。如果一个算法包含两个嵌套循环,那么其执行次数可能会增加,从而导致时间复杂度增加。具体来说,如果嵌套循环的次数与输入规模呈线性关系,那么时间复杂度就是线性的;如果呈对数关系,那么时间复杂度就是对数的;如果呈平方关系,那么时间复杂度就是二次的。在本题中,由于没有给出具体的算法和输入规模,我们无法确定时间复杂度具体是多少,但可以确定的是它不会是常数和logarithmic。因此,选项D是正确答案。'The

preorder

traversal

sequence

of

a

binary

search

tree

is

30,

20,

10,

15,

25,

23,

39,

35,

42.

Which

one

of

the

following

is

the

postorder

traversal

sequence

of

the

same

tree?(

)

A:15,

10,

25,

23,

20,

42,

35,

39,

30B:15,

20,

10,

23,

25,

42,

35,

39,

30C:15,

10,

23,

25,

20,

35,

42,

39,

30D:10,

20,

15,

23,

25,

35,

42,

39,

30答案:AI参考:答案为D:10,

20,

15,

23,

25,

35,

42,

39,

30\n\n原始二叉搜索树的前序遍历序列为30,20,10,15,25,23,39,35,42,因此可以推断出它是一个二叉搜索树。对于一个二叉搜索树,前序遍历的逆序后序遍历也是一棵二叉搜索树。所以选项D是正确的后序遍历序列。因此,答案为D。'The

______implementation

uses

arrays

to

create

stack.(

)

A:linkedB:static

C:dynamicD:linear答案:AI参考:正确答案是C:dynamic。\n根据题意,这个动态的实现使用数组来创建堆栈。因此,选项C“dynamic”是正确答案。选项A“linked”表示链接的,选项B“static”表示静态的,选项D“linear”表示线性的,都与题目中的描述不符。'68.

What

is

the

not

the

property

of

linked

list?

(

)

A:The

space

required

is

proportional

to

its

lengthB:Random

access

of

any

node

is

easyC:There

is

no

need

to

estimate

the

storage

space

D:Insertion

and

deletion

do

not

require

the

element

to

be

moved答案:AI参考:正确答案是:D:Insertion

and

deletion

do

not

require

the

element

to

be

moved。\n链表是一种非连续存储结构,因此插入和删除不需要移动元素,所以D选项正确。空间需求与长度成比例,这是数组的特点;链表节点随机访问困难;插入和删除需要估计存储空间。因此,选项A、B、C都不正确。'48.

What

is

the

maximum

number

of

nodes

with

degree

zero

in

a

binary

tree

at

level

3?

(

)

A:3B:5C:9D:4答案:AI参考:正确答案是B,5。在一个二叉树中,如果一个节点的高度为n,那么它左右子树的高度之和最多为n-1。因此,一个节点的高度为3时,其左右子树最多可以有两个。另外,高度为3的节点可能是根节点或者是第二个级别下得第二个节点的右子节点或第三个级别的根节点,这样使得所有可能的度为0的节点总数不超过5个。因此,答案为B。'Identify

the

infix

expression.(

)

A:None

of

the

aboveB:+A

BC:AB+

D:A+B答案:AI参考:正确答案是D:A+B。\n根据题目中的描述,需要识别一个中缀表达式。选项A表示“以上都不是”,不符合中缀表达式的定义;选项B和C中的符号不符合中缀表达式的规则;只有选项D中的A+B符合中缀表达式的定义,即运算符位于两个操作数之间。因此,正确答案是D。'In

order

to

keep

track

of

current

topmost

element

of

the

stack

we

need

to

maintain

one

variable

called(

)

A:falseB:bottomC:topD:true答案:AI参考:正确选项是B:bottom。\n\n在题目中提到需要维护一个变量来追踪栈中当前最顶部的元素,而选项B“bottom”正是这样一个变量名称,它通常用于表示栈的最底部元素。其他选项A、C、D都不符合题意。因此,答案为B。'When

user

switch

from

one

function

to

other

then

the

details

of

previous

function

are

stored

into

the

stack.(

)

A:TrueB:False答案:AI参考:答案:A:True\n根据题目描述,当用户从一个功能切换到另一个功能时,前一个功能的详细信息会被存储到堆栈中。所以这个说法是正确的,即选项A为正确答案。'Array

which

is

having

____________

dimensions

is

called

as

2-D

array.(

)

A:4B:3C:1D:2答案:AI参考:正确答案是:D:2。\n本题考察数组维度知识。题目中描述“一个具有**2**维度的数组”也就是一个二维数组。所以答案是D选项。'The

________notation

is

used

in

Computer

Science

to

describe

the

performance

or

complexity

of

an

algorithm.(

A:Big

PB:Small

OhC:BigD:Big

Oh答案:AI参考:正确答案是D:Big

Oh。\n表示法"表示法",因此要选择与"表示法"相符的词。在选项中只有D是表示"大"的意思,故答案为D。因此,正确答案是D,表示法的标志。BigOh(大O符号)是一种表示算法复杂性的方法,主要用于衡量算法执行时间对输入大小的敏感度。故答案为D。'4.

Within

a

computer,

all

information

is

accessed,

processed

and

transmitted

in

the

form

of:(

)

A:HexadecimalB:BCD

C:ACSIID:Binary

答案:AI参考:正确答案是D:二进制。\n计算机内部所有信息都是以二进制的形式进行访问、处理和传输的。因此,正确答案是D。二进制是一种只有0和1两种状态的比特序列,是计算机中常用的数据表示和传输方式。其他选项中,十六进制、BCD和ACSII都不是计算机内部信息表示和传输的标准方式。'Which

of

the

following

data

structures

is

a

nonlinear

structure?

(

)

A:Binary

treeB:Stack

C:Queue

D:Linked

list

答案:AI参考:正确答案是D:Linkedlist。\n链表是一种非线性的数据结构,它是由一系列节点组成的,每个节点包含数据和指向下一个节点的指针。而二叉树、栈和队列都是线性结构,其中二叉树是树形结构,栈是后进先出(LIFO)的数据结构,队列是先进先出(FIFO)的数据结构。因此,答案为D。'64.

What

of

the

following

statements

is

incorrect

regarding

linked

lists?

(

)

A:Linked

lists

are

example

for

dynamic

data

structureB:Linked

lists

example

for

linear

data

structureC:Linked

lists

can

be

circularD:Linked

lists

is

an

example

of

nonlinear

data

structure答案:AI参考:题目描述:以下关于链表的陈述哪个不正确?\n\n根据题目要求,我们需要找出关于链表表述不正确的选项。\n\n选项分析:\n\nA.Linkedlistsareexamplefordynamicdatastructure(链表是动态数据结构的示例)-正确。链表是一种动态数据结构,可以根据需要动态地添加或删除元素。\n\nB.Linkedlistsareexampleforlineardatastructure(链表是线性数据结构的示例)-错误。链表是一种链式结构,每个元素都链接到下一个元素,因此是线性的。\n\nC.Linkedlistscanbecircular(链表可以是循环的)-正确。链表可以通过在最后一个元素后链接一个新的元素形成一个循环。\n\nD.Linkedlistsisanexampleofnonlineardatastructure(链表是非线性数据

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论