Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 29 pages
Exam (elaborations)

WGU C960 PRE-ASSESSMENT: DISCRETE MATHEMATICS II (GFO1) (PGFO)| ACTUAL QUESTIONS AND ANSWERS | 2026 UPDATE | 100% CORRECT

Document preview thumbnail
Preview 3 out of 29 pages

Consider the following pseudocode that merges two lists of numbers into one: Merge0(List1, List2) Set OUTlist to empty While List1 is not empty OR List2 is not empty If one list is empty and the other is not, Remove the first number from the non-empty list and add it to OUTlist If both lists are non-empty, Remove the first number from List1 and add it to OUTlist Remove the first number from List2 and add it to OUTlist Return OUTlist If ListA is [1, 3, 5] and ListB is [2, 4, 6] then what is the result of Merge0 (ListA, Merge0 (ListB, ListA))? CORRECT ANSWER [ 1, 2, 3, 4, 5, 6 ] YOUR ANSWER [ 1, 1, 3, 2, 5, 3, 4, 5, 6 ] [ 2, 1, 4, 3, 6, 5 ] [ 1, 2, 3, 1, 5, 4, 3, 6, 5 ] 2. Given this pseudocode: S = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20} x = 2 While(x11): For i in S: If 0 ≡ i mod x and i ≠ x: delete i from S end-If end-For x = x + 1 end-While What is S at the end of this code? YOUR ANSWER CORRECT ANSWER ∅ {2, 3, 5, 7} {11, 13, 17, 19} {2, 3, 5, 7, 11, 13, 17, 19} 3. Given the pseudocode fragment: x := 2 count := 4 while (count 0) x := 2 × x count := count - 1 End-while What is the final value for x? YOUR ANSWER CORRECT ANSWER 4 16 32 64 4. Given this pseudocode that extracts a sample sequence from the data sequence of length N: Function Sampler (Sequence Data) Set Sample to an empty sequence Set N to the length of Data While N=1 Append element N of Data to Sample N:= N/2 Return Sample What is the worst-case run time for Function Sampler? YOUR ANSWER CORRECT ANSWE

Content preview

WGU C960 PRE-ASSESSMENT: DISCRETE MATHEMATICS II
(GFO1) (PGFO)
Attempt #1
Status: Passed


1. Consider the following pseudocode that merges two lists of numbers into one:

Merge0(List1, List2)
Set OUTlist to empty
While List1 is not empty OR List2 is not empty
If one list is empty and the other is not,
Remove the first number from the non-empty list and add it to OUTlist
If both lists are non-empty,
Remove the first number from List1 and add it to OUTlist
Remove the first number from List2 and add it to OUTlist
Return OUTlist

If ListA is [1, 3, 5] and ListB is [2, 4, 6] then what is the result of Merge0 (ListA, Merge0 (ListB, ListA))?
YOUR CORRECT
ANSWER ANSWER


[ 1, 2, 3, 4, 5, 6 ]


[ 1, 1, 3, 2, 5, 3, 4, 5, 6 ]


[ 2, 1, 4, 3, 6, 5 ]


[ 1, 2, 3, 1, 5, 4, 3, 6, 5 ]

,2. Given this pseudocode:

S = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}
x=2
While(x<11):
For i in S:
If 0 ≡ i mod x and i ≠ x:
delete i from S
end-If
end-For
x=x+1
end-While

What is S at the end of this code?
YOUR CORRECT
ANSWER ANSWER






{2, 3, 5, 7}


{11, 13, 17, 19}


{2, 3, 5, 7, 11, 13, 17, 19}



3. Given the pseudocode fragment:

x := 2
count := 4
while (count > 0)
x := 2 × x
count := count - 1
End-while

What is the final value for x?
YOUR CORRECT
ANSWER ANSWER




4


16


32


64

, 4. Given this pseudocode that extracts a sample sequence from the data sequence of length N:

Function Sampler (Sequence Data)
Set Sample to an empty sequence
Set N to the length of Data
While N>=1
Append element N of Data to Sample
N:= N/2
Return Sample

What is the worst-case run time for Function Sampler?
YOUR CORRECT
ANSWER ANSWER


O(log2N)



O(N/2)


O(N)


O(Nlog2N)

Document information

Uploaded on
September 11, 2026
Number of pages
29
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$11.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Brainarium
3.8
(338)
Sold
2031
Followers
1048
Items
24235
Last sold
1 day ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions