WGU C949 Objective Assessment V1 (New 2023/ 2024) Data Structures and Algorithms I | Questions and Verified Answers| 100% Correct| Grade A
WGU C949 Objective Assessment V1 (New
2023/ 2024) Data Structures and Algorithms I
| Questions and Verified Answers| 100%
Correct| Grade A
Q:UESTION
Which sequence of letters represents preorder traversal of the nodes of this tree?
A
/ \
B C
/ \
/ \
D E
\ / \
F G H
/
I
Answer:
A B C D F E G I H
Q:UESTION
An array soc of size 1009 is used where the index is an integer in [0,1008] and the hash-function
key%1009.
Where will the data associated with the key given by the last 4 social security digits ‘2023’ be
stored?
Answer:
In soc[5]
Q:UESTION
A stack s, a queue q, and a max value priority queue p each have a single 3 in them. Next
s.push(4), q.push(4), and p.push(4) are executed.
What is the triple (s.pop(), q.pop(), p.pop())?
Answer:
(4,3,4)
Q:UESTION
This stack reads left to right with the top to the right:
‘green’
‘yellow’
‘blue’
‘red’
What could be the stack after a push operation?
Answer:
[‘red’,’blue’,’yellow’, ‘green’, ‘purple”]
Q:UESTION
Items were added sequentially onto the stack starting with ‘red’:
‘green’
‘yellow’
‘blue’
‘red’
What is the stack after a pop operation?
Answer:
‘yellow’
‘blue’
‘red’
Q:UESTION
Which command helps to speed up comparisons using dictionary keys during a dictionary (d)
lookup in this pseudocode clip?
h = hash(key)
for pair in d:
if h == pair[0]:
return pair[1]
Answer:
hash(object)
Q:UESTION
What does the method any(b) return in Python if b is a dictionary?
Answer:
Returns True if any key of the dictionary is true.
Q:UESTION
Which Java method is used to read bytes from a standard file?
Answer:
Java.io.FileInputStream
Q:UESTION
Which command will retrieve an item from the top of the stack?
Answer:
Pop()
Q:UESTION
Which command will insert object x at position index in a list?
Answer:
Add(int index, Object x)
Powered by https://learnexams.com/search/study?query=