WGU C949 STUDY GUIDE: UNDERSTANDING
ALGORITHMS AND DATA STRUCTURES | VERIFIED
STUDY | 2026 STUDY UPDATES 100% CORRECT
Competencies and Topics
Explains Algorithms - 29% of assessment
Characteristics of Algorithms
Finiteness
An algorithm must always have a finite number of steps before it ends. When the operation is finished,
it must have a defined endpoint or output and not enter an endless loop.
Definiteness
An algorithm needs to have exact definitions for each step. Clear and straightforward directions ensure
that every step is understood and can be taken easily.
Input
An algorithm requires one or more inputs. The values that are first supplied to the algorithm before its
processing are known as inputs. These inputs come from a predetermined range of acceptable values.
Output
One or more outputs must be produced by an algorithm. The output is the outcome of the algorithm
after every step has been completed. The relationship between the input and the result should be clear.
Effectiveness
An algorithm's stages must be sufficiently straightforward to be carried out in a finite time utilizing
fundamental operations. With the resources at hand, every operation in the algorithm should be doable
and practicable.
, lOMoAR cPSD| 62301842
●
Generality
Rather than being limited to a single particular case, an algorithm should be able to solve a group of
issues. It should offer a generic fix that manages a variety of inputs inside a predetermined range or
domain.
NP-complete problems are a set of problems for which no known efficient algorithm exists.
Factors of an Algorithm
● Modularity: This feature was perfectly designed for the algorithm if you are given a problem and
break it down into small-small modules or small-small steps, which is a basic definition of an
algorithm.
● Correctness: An algorithm's correctness is defined as when the given inputs produce the desired
output, indicating that the algorithm was designed correctly. An algorithm's analysis has been
completed correctly.
● Maintainability: It means that the algorithm should be designed in a straightforward, structured
way so that when you redefine the algorithm, no significant changes are made to the algorithm.
● Functionality: It takes into account various logical steps to solve a real-world problem.
● Robustness: Robustness refers to an algorithm's ability to define your problem clearly.
● User-friendly: If the algorithm is difficult to understand, the designer will not explain it to the
programmer.
● Simplicity: If an algorithm is simple, it is simple to understand.
● Extensibility: Your algorithm should be extensible if another algorithm designer or programmer
wants to use it.
Types of Algorithms
● Brute Force Algorithm: A straightforward approach that exhaustively tries all possible solutions,
suitable for small problem instances but may become impractical for larger ones due to its high
time complexity.
● Recursive Algorithm: A method that breaks a problem into smaller, similar subproblems and
repeatedly applies itself to solve them until reaching a base case, making it effective for tasks
with recursive structures.
● Encryption Algorithm: Utilized to transform data into a secure, unreadable form using
cryptographic techniques, ensuring confidentiality and privacy in digital communications and
transactions.
, lOMoAR cPSD| 62301842
● Backtracking Algorithm: A trial-and-error technique used to explore potential solutions by
undoing choices when they lead to an incorrect outcome, commonly employed in puzzles and
optimization problems.
Searching Algorithm: Designed to find a specific target within a dataset, enabling efficient
retrieval of information from sorted or unsorted collections.
● Sorting Algorithm: Aimed at arranging elements in a specific order, like numerical or
alphabetical, to enhance data organization and retrieval.
● Hashing Algorithm: Converts data into a fixed-size hash value, enabling rapid data access and
retrieval in hash tables, commonly used in databases and password storage.
● Divide and Conquer Algorithm: Breaks a complex problem into smaller subproblems, solves
them independently, and then combines their solutions to address the original problem
effectively.
● Greedy Algorithm: Makes locally optimal choices at each step in the hope of finding a global
optimum, useful for optimization problems but may not always lead to the best solution.
● Dynamic Programming Algorithm: Stores and reuses intermediate results to avoid redundant
computations, enhancing the efficiency of solving complex problems.
● Randomized Algorithm: Utilizes randomness in its steps to achieve a solution, often used in
situations where an approximate or probabilistic answer suffices.
Recursive algorithms
Recursive algorithms are a fundamental concept in computer science, particularly in the study of data
structures and algorithms. A recursive algorithm is one that solves a problem by breaking it down into
smaller instances of the same problem, which it then solves in the same way. This process continues
until the problem is reduced to a base case, which is solved directly without further recursion.
Key Concepts of Recursive Algorithms
1. Base Case: This is the condition under which the recursion stops. It represents the simplest
instance of the problem, which can be solved directly without further recursion.
2. Recursive Case: This is the part of the algorithm that breaks the problem down into smaller
instances of the same problem and then calls the algorithm recursively on these smaller
instances.
3. Stack: Each recursive call is placed on the system call stack. When the base case is reached, the
stack begins to unwind as each instance of the function returns its result.
Example: Factorial Calculation
The factorial of a number n (denoted as n!) is a classic example of a recursive algorithm. The factorial is
defined as:
, lOMoAR cPSD| 62301842
●
● O! = 1 (Base Case)
● N! = n * (n-1)! For n > O (Recursive Case) Here’s how it looks in code:
def factorial(n): if n
== 0: # Base Case
return 1
else: # Recursive Case
return n * factorial(n - 1)
How It Works:
● Base Case: When n is 0, the function returns 1.
● Recursive Case: For any other value of n, the function calls itself with n−1 and multiplies the
result by n.
For example, calling factorial(3) would work as follows:
● factorial(3) calls factorial(2)
● factorial(2) calls factorial(1)
● factorial(1) calls factorial(0)
● factorial(0) returns 1, then: ← BASE CASE
● factorial(1) returns 1 * 1 = 1 ● factorial(2) returns 2 * 1 = 2
● factorial(3) returns 3 * 2 = 6
Advantages of Recursion
● Simplicity: Recursive solutions are often more elegant and easier to understand than their
iterative counterparts.
● Direct Translation: Some problems are naturally recursive, like tree traversals, making recursion
the most straightforward approach.
Disadvantages of Recursion
Performance: Recursive algorithms can be less efficient due to the overhead of multiple function
calls and potential stack overflow issues for deep recursion.
● Memory Usage: Recursion can consume more memory because each function call adds a new
frame to the call stack.
When to Use Recursion