C949 WGU C949 - Data Structures and
Algorithms Pre-Assessment |
FREQUENTLY TESTED QUESTIONS
WITH CORRECT ANSWERS | BRAND
NEW!
Whichnstatementndescribesnanqueuendatanstructure?
A.)nItnisnansequencenofnelementsninnwhichninsertionnandndeletionntakesnplacenatnonenend.
B.)nItnisnansequencenofnelementsninnwhichninsertionnandndeletionntakesnplacenatnbothnends.
C.)nItnisnansequencenofnelementsninnwhichninsertionncanntakenplacenanywhereninnthensequencenandn
deletionntakesnplacenonlynatnthenfront.
D.)nItnisnansequencenofnelementsninnwhichninsertionsncanntakenplacenonlynatnthenbacknendnandndelet
ionsncanntakenplacenonlynatnthenfrontnend.n-nCORRECTnANSWERnD
Whichndatanstructurenallowsninsertingnandndeletingndatanelementsnatnbothnthenfrontnandnthenrear?
A.)nTrees
B.)nDeques
C.)nStacks
D.)nQueuesn-nCORRECTnANSWERnB
Whichndatanstructurenallowsnelementsntonbeninsertednandndeletednfromnonenendnandnprovidesnnon
directnaccessntonthenothernend?
A.)nList
B.)nDeque
,C.)nStack
D.)nQueuen-nCORRECTnANSWERnC
Whatnarenthenofficialnindexesnfornthenlistnlist01ngivennthisndeclaration?
int[n]nlist01n=n{0,n2,n4,n6,n8,n10};
A.)n0,n1,n2,n3,n4,n5
B.)n0,n2,n4,n6,n8,n10
C.)n1,n2,n3,n4,n5,n6
D.)n2,n4,n6,n8,n10,n12n-nCORRECTnANSWERnA
Whichnabstractndatantypen(ADT)nhasnelementsnofnthensamentypensonthatnthenelementsncannbenretri
evednbasednonnthenindexnornposition?
A.)nList
B.)nBag
C.)nStack
D.)nQueuen-nCORRECTnANSWERnA
Whichndatanstructurenallowsninsertionnandnremovalnfromnonlynonenendnofnthendatanstructure?
A.)nList
B.)nQueue
C.)nStack
D.)nDequen-nCORRECTnANSWERnC
,Whichndatantypendoesnthenmysterynfunctionnreturn?return_typenmysteryn(intnR)
{
intnNumUnitsn=nR;
returnnNumUnitsn*n3.14;
}
A.)nByte
B.)nString
C.)nDouble
D.)nBooleann-nCORRECTnANSWERnC
Whichncategorynofndatandoesn("FB",n75.00,n75.03,n74.90)nrepresentninnthenpseudocode?
importndatetime
defnmiddle(stock,ndate):
symbol,ncurrent,nhigh,nlown=nstock
n
returnn(((highn+nlow)n/n2),ndate)
n
mid_value,ndaten=nmiddle(("FB",n75.00,n75.03,n74.90),
datetime.date(2014,n10,n31))
n
A.)nList
B.)nFloat
C.)nTuple
D.)nOperatorn-nCORRECTnANSWERnC
, WhichnvaluenisnappropriatenfornTest1ngivennthenexpression?
charnTest1;
A.)n'L'
B.)n77
C.)n6.5
D.)n"value"n-nCORRECTnANSWERnA
Whichnvaluenisnappropriatenfornthenvariablenmiddlengivennthenpseudocode?
functionnmystery()
{
stringnlast;
stringnfirst;
charnmiddle;
intnphone;
floatnrate;
}
A.)n'D'
B.)n'Da'
C.)n"david"
D.)n"David"n-nCORRECTnANSWERnA
Algorithms Pre-Assessment |
FREQUENTLY TESTED QUESTIONS
WITH CORRECT ANSWERS | BRAND
NEW!
Whichnstatementndescribesnanqueuendatanstructure?
A.)nItnisnansequencenofnelementsninnwhichninsertionnandndeletionntakesnplacenatnonenend.
B.)nItnisnansequencenofnelementsninnwhichninsertionnandndeletionntakesnplacenatnbothnends.
C.)nItnisnansequencenofnelementsninnwhichninsertionncanntakenplacenanywhereninnthensequencenandn
deletionntakesnplacenonlynatnthenfront.
D.)nItnisnansequencenofnelementsninnwhichninsertionsncanntakenplacenonlynatnthenbacknendnandndelet
ionsncanntakenplacenonlynatnthenfrontnend.n-nCORRECTnANSWERnD
Whichndatanstructurenallowsninsertingnandndeletingndatanelementsnatnbothnthenfrontnandnthenrear?
A.)nTrees
B.)nDeques
C.)nStacks
D.)nQueuesn-nCORRECTnANSWERnB
Whichndatanstructurenallowsnelementsntonbeninsertednandndeletednfromnonenendnandnprovidesnnon
directnaccessntonthenothernend?
A.)nList
B.)nDeque
,C.)nStack
D.)nQueuen-nCORRECTnANSWERnC
Whatnarenthenofficialnindexesnfornthenlistnlist01ngivennthisndeclaration?
int[n]nlist01n=n{0,n2,n4,n6,n8,n10};
A.)n0,n1,n2,n3,n4,n5
B.)n0,n2,n4,n6,n8,n10
C.)n1,n2,n3,n4,n5,n6
D.)n2,n4,n6,n8,n10,n12n-nCORRECTnANSWERnA
Whichnabstractndatantypen(ADT)nhasnelementsnofnthensamentypensonthatnthenelementsncannbenretri
evednbasednonnthenindexnornposition?
A.)nList
B.)nBag
C.)nStack
D.)nQueuen-nCORRECTnANSWERnA
Whichndatanstructurenallowsninsertionnandnremovalnfromnonlynonenendnofnthendatanstructure?
A.)nList
B.)nQueue
C.)nStack
D.)nDequen-nCORRECTnANSWERnC
,Whichndatantypendoesnthenmysterynfunctionnreturn?return_typenmysteryn(intnR)
{
intnNumUnitsn=nR;
returnnNumUnitsn*n3.14;
}
A.)nByte
B.)nString
C.)nDouble
D.)nBooleann-nCORRECTnANSWERnC
Whichncategorynofndatandoesn("FB",n75.00,n75.03,n74.90)nrepresentninnthenpseudocode?
importndatetime
defnmiddle(stock,ndate):
symbol,ncurrent,nhigh,nlown=nstock
n
returnn(((highn+nlow)n/n2),ndate)
n
mid_value,ndaten=nmiddle(("FB",n75.00,n75.03,n74.90),
datetime.date(2014,n10,n31))
n
A.)nList
B.)nFloat
C.)nTuple
D.)nOperatorn-nCORRECTnANSWERnC
, WhichnvaluenisnappropriatenfornTest1ngivennthenexpression?
charnTest1;
A.)n'L'
B.)n77
C.)n6.5
D.)n"value"n-nCORRECTnANSWERnA
Whichnvaluenisnappropriatenfornthenvariablenmiddlengivennthenpseudocode?
functionnmystery()
{
stringnlast;
stringnfirst;
charnmiddle;
intnphone;
floatnrate;
}
A.)n'D'
B.)n'Da'
C.)n"david"
D.)n"David"n-nCORRECTnANSWERnA