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 4 out of 47 pages
Exam (elaborations)

WGU C949 Final Exam Data Structures and Algorithms – Higher Education Computer Science Curriculum

Document preview thumbnail
Preview 4 out of 47 pages

WGU C949 Final Exam Data Structures and Algorithms – Higher Education Computer Science Curriculum

Content preview

WGU C949 Final Exam Data Structures and Algorithms –
Higher Education Computer Science Curriculum
Section 1: Foundational Concepts & Pseudocode (1-15)
1. What is the primary difference between an Abstract Data Type (ADT) and a
Data Structure?
• A) An ADT is a physical implementation, while a data structure is a logical
definition.
• B) An ADT defines the behavior (operations) without specifying
implementation, while a data structure is a concrete way to store and
organize data.
• C) There is no difference; the terms are interchangeable.
• D) An ADT is always more efficient than a data structure.

Correct Answer: B
Rationale: An ADT (like a Stack) specifies what operations are possible (push,
pop) and their behavior. A data structure (like an Array or Linked List) is
the how—a specific, concrete implementation used to realize the ADT.
2. In pseudocode, what does the operation x ← y signify?
• A) Compare x and y for equality.
• B) Assign the value of y to x.
• C) Return the value of x and y.
• D) Swap the values of x and y.

Correct Answer: B
Rationale: The left-arrow operator ← is standard in pseudocode to denote
assignment. It takes the value from the right side and stores it in the variable on
the left side.
3. Given the following pseudocode, what is the final value of sum?
text

,sum ← 0
FOR i ← 1 TO 5
IF i MOD 2 == 0 THEN
sum ← sum + i
ENDIF
ENDFOR
• A) 6
• B) 9
• C) 15
• D) 0

Correct Answer: A
Rationale: The loop iterates from 1 to 5. The condition i MOD 2 == 0 is true
for even numbers: 2 and 4. The sum is 0 + 2 + 4 = 6.
4. Which of the following is a characteristic of a well-designed algorithm?
• A) It must be implemented in a specific programming language.
• B) It is unambiguous and has clearly defined steps.
• C) It produces an output for any set of inputs, valid or invalid.
• D) It should be as complex as possible to handle all edge cases.

Correct Answer: B
Rationale: Unambiguity and well-defined steps are fundamental to an
algorithm. It must be a finite, clear sequence of instructions. While handling
invalid inputs is good, an algorithm doesn't have to produce a correct output for
them, just a defined response (e.g., an error). Complexity is not a goal.
5. What is the purpose of a WHILE loop in pseudocode?
• A) To execute a block of code a predetermined number of times.

, • B) To execute a block of code zero or more times based on a condition
being true.
• C) To execute a block of code at least once before checking a condition.
• D) To execute a block of code for each item in a collection.

Correct Answer: B
Rationale: A WHILE loop checks the condition before each iteration. If the
condition is initially false, the block of code is never executed. It runs zero or more
times.
6. Which data structure is best described as a "First-In, First-Out" (FIFO)
structure?
• A) Stack
• B) Queue
• C) Linked List
• D) Array

Correct Answer: B
Rationale: The FIFO principle is the defining characteristic of a Queue. The
first element added (enqueued) is the first one removed (dequeued).
7. In the context of algorithm design, what is "abstraction"?
• A) Hiding complex implementation details and exposing only the essential
features.
• B) Breaking a problem down into smaller, more manageable sub-problems.
• C) Finding a more efficient way to solve a problem.
• D) A method for testing the functionality of an algorithm.

Correct Answer: A
Rationale: Abstraction is a fundamental principle of computer science that
focuses on what a system does, not how it does it. It helps manage complexity.
8. The parameters of a recursive function are used to:

, • A) Maintain global state.
• B) Determine the next value in a sequence.
• C) Track the progress of the recursion and define the base case.
• D) Store the final result of the calculation.

Correct Answer: C
Rationale: Parameters in recursive functions are crucial for passing state
down the call stack. They change with each call, allowing the function to work on
a smaller version of the problem and eventually reach the base case.
9. What is the base case in a recursive function?
• A) The most complex case that requires the most computation.
• B) The condition that stops the recursion and returns a value without
further recursive calls.
• C) The first recursive call made by the function.
• D) The last recursive call made before the function returns.

Correct Answer: B
Rationale: The base case is the termination condition. Without it, the
recursion would continue infinitely (or until a stack overflow).
10. What is the primary benefit of using modularity when designing an
algorithm?
• A) It increases the overall execution speed.
• B) It allows different team members to work on different parts
simultaneously.
• C) It eliminates the need for comments in the code.
• D) It ensures that the algorithm is bug-free.

Correct Answer: B
Rationale: Modularity means breaking the algorithm into independent, self-

Document information

Uploaded on
September 12, 2026
Number of pages
47
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$26.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.
Sold
19
Followers
1
Items
1322
Last sold
3 days 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