WGU C949 Exam Review C949 WGU C949 - Data Structures and Algorithms Pre-Assessment | FREQUENTLY TESTED QUESTIONS WITH CORRECT ANSWERS | BRAND NEW!

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/159

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:27 PM on 6/19/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

160 Terms

1
New cards

Algorithm

A set of instructions followed step by step to solve a problem

2
New cards

Characteristics of an Algorithm

1. Clear & unambiguous

2. Well-defined inputs

3. Well-defined outputs

what will be produced?

4. Finite-ness

5. Feasible

6. Language independent

3
New cards

Factors of an Algorithm

1. Modularity (can be broken down)

2. Correctness

3. Maintainability (no major changes when redefining the algorithm)

4. Functionality

5. Robustness (ability to define problem clearly)

6. User friendly

7. Simplicity

8. Extensibility (Future developers can understand it & build upon it)

4
New cards

Which factor takes the ability to easily update an algorithm into consideration?

maintainability

5
New cards

What is a high-level consideration in an algorithm’s design?

simplicity

6
New cards

Prior analysis

things you'd consider before implementing an algorithm, such as processing speed

7
New cards

Post analysis

happens after implementation

8
New cards

Types of Algorithms

-Brute-force algorithm

-Searching algorithm

-Sorting algorithm

-Recursive algorithm

-Backtracking algorithm

-Divide & conquer algorithm

-Greedy algorithm

-Dynamic programming algorithm

-Randomized algorithm

9
New cards

Brute Force Algorithm

an algorithm that tries all possible solutions in order then chooses the best one

10
New cards

Example of searching algorithms

linear search and binary search

11
New cards

Linear Search Algorithm

Starts from the beginning of a list & checks each element until the search key is found or the end of the list is reached.

Data can be sorted or unsorted

12
New cards

Binary Search Algorithm

starts at the middle of a sorted data set of numbers and eliminates half of the data; this process repeats until the desired value is found or all elements have been eliminated

13
New cards

Sorting Algorithms

Bubble Sort

Selection Sort

Insertion Sort

Quick Sort

Merge Sort

RADIX

14
New cards

Bubble Sort Algorithm

Compares elements that are side by side & determine if the left element is greater than the right element. If so, it swaps them and continues to compare elements until it reaches the end of the list. The largest # is "bubbled" to the top of the list

15
New cards

Selection Sort Algorithm

finds the lowest value in an array & moves it to the front of an array

Uses a sorted & unsorted list

*nested loop

16
New cards

Insertion Sort Algorithm

Takes 2 elements & moves them to a sorted list, sorts them least to greatest, then goes back to the unsorted list & keeps moving elements down to the sorted list, making swaps 1 at a time until the list is fully sorted.

17
New cards

Quicksort Algorithm

Quicksort divides the array into 2 parts low & high)

All values in the low partition are <= to the pivot value

All values in the high partition are >= to the pivot value

18
New cards

Merge Sort Algorithm

Breaks data into small groups, puts the groups in order, then combines groups until all are in order

*divide & conquer algorithm

19
New cards

What function is used with a merge sort?

recursion

20
New cards

Radix Sort

distributes the elements into buckets based on each digit's value. By repeatedly sorting the elements by their significant digits, from the least significant to the most significant, Radix Sort achieves the final sorted order.

21
New cards

greedy algor

finds the best solution at a give moment

22
New cards

Data structure

A way of storing, organizing, and performing operations on data

23
New cards

Nonlinear Data Structures

Elements are not in sequential order

Ex: tree & graph

24
New cards

Linear Data structure

Elements are in sequential order and adjacent elements are attached

25
New cards

List examples of data structures

1. Record

2. Array

3. Linked list

4. Binary Tree

5. Hash table

6. Heap

7. Graph

26
New cards

Record

a data structure that stores subitems

27
New cards

Array

a data structure that is ordered and indexed. It's elements are mutable, but must be of the same data type. Duplicates are allowed

28
New cards

Linked list

ordered list of items stored in nodes

each node stores data & pointer to (or the address of) the next node

elements are linked using pointers

<p>ordered list of items stored in nodes</p><p>each node stores data &amp; pointer to (or the address of) the next node</p><p>elements are linked using pointers</p>
29
New cards

T/F: Linked list have slower access times than arrays

True because they are not indexed

30
New cards

Binary Tree

a data structure in which each node stores data and has up to two children

the top node is the root

<p>a data structure in which each node stores data and has up to two children</p><p>the top node is the root</p>
31
New cards

parts of a binary tree

root - the top node (no parent)

node - each child

leaf - a node with no child

internal node - has at least 1 child

32
New cards

edge

The link (line) from a node to a child in a graph

33
New cards

depth

The # of edges on the path from the root to the node

The root node has depth 0

34
New cards

level

Nodes with the same depth form a tree level

35
New cards

height

The largest depth of any node

A tree w/ 1 node as height 0

36
New cards

Hash Table

a data structure that stores unordered items by mapping (or hashing) each item to a location in an array

37
New cards

what are elements in a hash table called?

bucket

38
New cards

how long does it take to search a well-designed hash table on average?

O(1)

39
New cards

Full Binary Tree

Each node has 0 or 2 children

<p>Each node has 0 or 2 children</p>
40
New cards

Complete Binary Tree

a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible

<p>a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible</p>
41
New cards

Perfect Binary Tree

all internal nodes have 2 children and all leaf nodes are at the same level

<p>all internal nodes have 2 children and all leaf nodes are at the same level</p>
42
New cards

Max Heap

a tree that maintains the simple property that a node's key is greater than or equal to the node's childrens' keys

43
New cards

Min Heap

a tree that maintains the simple property that a node's key is less than or equal to the node's childrens' keys

44
New cards

graph

a data structure for representing connections among items

A vertex (or node) represents an item in a graph

An edge represents a connection b/w vertices

45
New cards

What operations are performed on a data structure?

accessing or updating stored data

searching for specific data

inserting new data

removing data

46
New cards

What is a class in OOP?

A blueprint for creating objects(instances)

47
New cards

Which characteristic of an algorithm is independent in nature?

Uses an agnostic code repository

Means it is language independent (multiple programming languages can implement it)

48
New cards

Time complexity

amount of time needed to execute code

includes an algorithms worst case

49
New cards

Space complexity

Quantity of space (in memory) required to solve a problem & produce an output

50
New cards

auxiliary space complexity

the space complexity not including the input data

51
New cards

What is the best case time complexity?

O(1)

element is at the beginning of list

52
New cards

what is the average case time complexity?

O(n)

element is in the middle

53
New cards

what is the worst case time complexity?

O(n)

element is at the end or not in the list

54
New cards

Abstract Data Type (ADT)

A data type whose properties are specified without prior knowledge of how they'll work

55
New cards

What is a high-level consideration in an algorithm’s design?

simplicity

56
New cards

What is the primary method used to search for an item in a sorted array?

binary search

57
New cards

Which algorithm requires data sorting as its first step?

binary search

58
New cards

Which data type do heap sorts work with?

tree-based structure

59
New cards

Which search algorithm has the best performance when the data set is sorted?

interval search

60
New cards

What is the advantage that a linked list has over an array?

grows and shrinks as needed

61
New cards

What would be the best data structure for a hash table with simple chaining?

doubly linked list

62
New cards

Which characteristic of a class allows it to be used as an abstract data type (ADT)?

It consists of variables and methods.

63
New cards

what does .pop() do for a stack

removes the 1st element from the top of the list

64
New cards

what does .pop() do for a queue

Popfront - Remove the list item from the front of the list

Pop back - Remove the list item from the back of the list

65
New cards

inorder traversal

left subtree, root, right subtree

66
New cards

preorder traversal

root, left subtree, right subtree

67
New cards

What uses the first in first out method

queue

68
New cards

what uses the last in first out method

stack

69
New cards

stack

Linear data structure where insertions & deletions are allowed only at the end (the top)

70
New cards

queue

Items are inserted at the end of the queue and removed from the front of the queue

71
New cards

Priority Queue

a queue in which the highest-priority elements are removed first; within a priority value, the earliest arrival is removed first.

72
New cards

what does the dequeue operation do

Removes & returns the item at the front of the queue

73
New cards

what does the enqueue operation do

Adding to the back (the end) of the line (queue)

74
New cards

what function removes all items from a list?

clear()

75
New cards

what function removes the 1st instance of a specified element?

remove()

76
New cards

what tool is used to implement a deque ADT

collections

77
New cards

Time complexity for bubble sort

O(n^2)

78
New cards

what kind of function would you see with bubble sort?

nested loop

79
New cards

Time complexity for merge sort

O(n log n)

80
New cards

Time complexity for selection sort

O(n^2)

81
New cards

Big O Notation

describes how the runtime of an algorithm grows as the input size grows

82
New cards

Determining big O: when adding terms what order term is kept?

Highest

83
New cards

Determining big O: when multiplying terms what happens to constants?

They are omitted

84
New cards

What runtime is O(1)

Constant

85
New cards

What runtime is O(log n)

Logarithmic

86
New cards

What runtime is O(n)

Linear

87
New cards

What runtime is O(n log n)

Loglinear

88
New cards

What runtime is O(n^2)

Quadratic

89
New cards

What runtime is O(c^n)

Exponential

90
New cards

Which tool in Python is used to implement a deque ADT?

collections

91
New cards

Which data structure is used to implement a dictionary data type?

hash table

92
New cards

Which operator is a type of assignment operator?

+=

3 multiple choice options

93
New cards

how do you determine the runtime of nested loops in big-O notation?

summing the runtime of the inner loop over each outer loop iteration

94
New cards

compression

transforms data to use fewer bits

95
New cards

set abstract data type

collection of distinct elements

96
New cards

what happens if you try to add an element to a set that already exists in the set?

there is no effect

97
New cards

T/F: Every set is a subset of itself.

true

98
New cards

T/F: For all elements in set X to also be in set Y, Y must have at least the same number of elements in X.

true

99
New cards

set - difference

The difference of sets X and Y, denoted as X \ Y, is a set that contains every element that is in X but not in Y, and no additional elements.

100
New cards

set - intersection

The intersection of sets X and Y, denoted as X ∩ Y, is a set that contains every element that is in both X and Y, and no additional elements.