WGU C949 - Data Structures And Algorithms Questions with 100% correct answers (scored 99.9%)

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

1/162

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:25 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

163 Terms

1
New cards

Algorithm

Describes a sequence of steps to solve a computational problem or perform a calculation.

2
New cards

Computational Problem

Specifies an input, a question about the input that can be answered using a computer, and the desired output.

3
New cards

Longest Common Substring

An algorithm that determines the longest common substring that exists in two inputs strings.

4
New cards

Binary Search

An efficient algorithm for searching a list. The list's elements must be sorted and directly accessible (such as an array).

5
New cards

Dijkstra's Shortest Path

An algorithm that determines the shortest path from a start vertex to each vertex in a graph.

6
New cards

NP-Complete

A set of problems for which no known efficient algorithm exists.

7
New cards

Polynomial time algorithm

An algorithm whose execution time grows as a polynomial of input size. An efficient algorithm is one whose runtime increases no more than polynomially with respect to the input size.

8
New cards

Data structure

A way of organizing, storing, and performing operations on data. Operations include accessing or updating stored data, searching for specific data, inserting new data, and removing data.

9
New cards

Record

A data structure that stores subitems, with a name associated with each subitem.

10
New cards

Array

A data structure that stores subitems, with a name associated with each subitem. May only store homogeneous data elements.

11
New cards

Linked list

A data structure that stores ordered list of items in nodes, where each node stores data and has a pointer to the next node.

12
New cards

Binary tree

A data structure in which each node stores data and has up to two children, known as a left child and a right child.

13
New cards

Hash table

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

14
New cards

Tree

A non-linear data structure that organizes data in a hierarchical way.

15
New cards

Heap

A complete binary tree-based data structure.

16
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.

17
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.

18
New cards

Graph

A data structure for representing connections among items, and consists of vertices connected by edges.

19
New cards

Vertex

Represents an item in a graph.

20
New cards

Edge

Represents a connection between two vertices in a graph.

21
New cards

Abstract Data Type (ADT)

A data type described by predefined user operations, such as "insert data at rear," without indicating how each operation is implemented.

22
New cards

List

An ADT for holding ordered data. Duplicate items are allowed.

23
New cards

Stack

An ADT in which items are only inserted on or removed from the top.

24
New cards

Queue

An ADT in which items are inserted at the end and removed from the front. referred to as a first-in first-out ADT.

25
New cards

Deque

An ADT in which items can be inserted and removed at both the front and back.

26
New cards

Bag

An ADT for storing items in which the order does not matter and duplicate items are allowed.

27
New cards

Set

An ADT for a collection of distinct items.

28
New cards

Priority Queue

A queue where each item has a priority, and items with higher priority are closer to the front of the queue than items with lower priority. Duplicates items are allowed.

29
New cards

Dictionary

An ADT that associates (or maps) keys with values. Can be used to describe associative relationships in Python.

30
New cards

Queue push

Inserts an item at the end of the queue.

31
New cards

Queue pop

Removes and returns the item at the front of the queue.

32
New cards

Queue peek

Returns but does not remove item at the front of the queue

33
New cards

Assignment statement

Assigns the name on the left side to reference the value on the right side.

34
New cards

Mutability

Indicates whether the object's value is allowed to change.

35
New cards

type()

A Python function that returns the class type of the argument (object) passed as parameter.

36
New cards

id()

A Python function that returns identity (unique integer) of an object.

37
New cards

name/identifier

A sequence of letters (a-z, A-Z, _) and digits (0-9), and must start with a letter. Note that "_", called an underscore, is considered to be a letter.

38
New cards

Reserved words

Words that have special meaning and therefore cannot be used as identifiers.

39
New cards

PEP 8

The Python style guide that outlines the basics of how to write Python code neatly and consistently.

40
New cards

floating-point literal

A number with a fractional part, even if that fraction is 0, as in 1.0, 0.0, or 99.573

41
New cards

Scientific notation

A floating-point literal written using an e preceding the power-of-10 exponent, as in 6.02e23 to represent 6.02x10^23. The e stands for exponent. Likewise, 0.001 is 1x10-^3 so can be written as 1.0e-3.

42
New cards

Overflow

Occurs when a value is too large to be stored in the memory allocated by the interpreter.

43
New cards

Expression

A combination of items such as variables, literals, and operators that evaluates to a value. Can be just a literal, just a variable, or some combination of variables, literals, and operators.

44
New cards

Literal

A specific value in code like 2 or "abc".

45
New cards

Operator

A symbol for a built-in language calculation like + for addition.

46
New cards

Modulo operator

Written as %, evaluates to the remainder of the division of the two integer operands.

47
New cards

String literal

A string value specified in the source code of a program.

48
New cards

Sequence type

A type that specifies a collection of objects ordered from left to right. A string's characters are ordered from the first letter of the string to the last.

49
New cards

Character index

The position of a character in a string.

50
New cards

len()

A Python function to find the length of a string (and any other sequence type).

51
New cards

any()

A Python function that returns True if any key of the dictionary is true.

52
New cards

Containers

Objects that contain references to other objects instead of data.

53
New cards

Element

An item of a list

54
New cards

Sequence-type functions

Built-in functions that operate on sequences like lists and strings.

55
New cards

Tuple

A data type behaves similar to a list but is immutable - once created the elements cannot be changed.

56
New cards

Numeric type

This type includes int and float which represent the most common types used to store data. These types all support the normal mathematical operations such as addition, subtraction, multiplication, and division, among others.

57
New cards

Mapping type

A mapping type is a data type comprised of a collection of keys and associated values. Python's only built-in mapping type is the dictionary. Dictionaries implement the associative array abstract data type.

58
New cards

membership operators

These operators include the in and not in operators and yield True or False if the left operand matches the value of some element in the right operand, which is always a container.

59
New cards

Function

A named series of statements

60
New cards

Block

A series of indented statements following the function definition.

61
New cards

duck typing

A form of dynamic typing based on the maxim "If a bird walks, swims, and quacks like a duck, then call it a duck".

62
New cards

local variables

Variables declared within a function or procedure and so can be accessed only by the code within that function or procedure

63
New cards

global variables

Variables declared in the main body of the program and so can be accessed anywhere in the code

64
New cards

global statement

A statement that must be used to change the value of a global variable inside of a function.

65
New cards

Scope

the area of code where a name is visible.

66
New cards

Scope resolution

The process of searching for a name in the available namespaces.

67
New cards

pass-by-assignment

Arguments to functions are passed by object reference

68
New cards

Class object

A factory that creates instance objects.

69
New cards

instance object

When created by the class object, this is initialized via the __init__ method.

70
New cards

class attribute

Defined within the scope of a class, this attribute is shared amongst all of the instances of that class

71
New cards

Instance attribute

This attribute is unique to each class instance and is created within a method, or from outside of the class' scope.

72
New cards

Clas interface

Consists of the methods that a programmer calls to create, modify, or access a class instance.

73
New cards

Class customization

The process of defining how a class should behave for some common operations. Such operations might include printing, accessing attributes, or how instances of that class are compared to each other.

74
New cards

operator overloading

This technique of Class customization can redefine the functionality of built-in operators like <, >=, +, -, and * when used with class instances.

75
New cards

rich comparison methods

Methods like __lt__ that can be altered using operator overloading

76
New cards

memory allocation

The process of an application requesting and being granted memory.

77
New cards

reference count

An integer counter that represents how many variables reference an object.

78
New cards

list object type

One of the most important and often used types in a Python program. It is a container, which is an object that groups related objects together. It is also a sequence; thus, the contained objects maintain a left-to-right positional ordering.

79
New cards

in-place modification

The capability of a list to grow and shrink without the program having to replace the entire list with an updated copy.

80
New cards

stride

An optional component of slice notation which indicates how many elements are skipped between extracted items in the source list.

81
New cards

list comprehension

a convenient construct that iterates over a list, modifies each element, and returns a new list consisting of the modified elements.

82
New cards

recursive function

A function that calls itself, either directly or indirectly.

83
New cards

base case

Every recursive function must have a case that returns a value without performing a recursive call.

84
New cards

constant time operation

An operation that, for a given processor, always operates in the same amount of time, regardless of input values.

85
New cards

Algorithm efficiency

Typically measured by the algorithm's computational complexity.

86
New cards

Computational complexity

The amount of resources used by the algorithm. The most common resources considered are the runtime and memory usage.

87
New cards

Runtime complexity

A function, T(N), that represents the number of constant time operations performed by the algorithm on an input of size N.

88
New cards

Space complexity

A function, S(N), that represents the number of fixed-size memory units used by the algorithm for an input of size N.

89
New cards

Auxiliary space complexity

The space complexity not including the input data.

90
New cards

Lower bound

A function f(N) that is ≤ the best case T(N), for all values of N ≥ 1.

91
New cards

Upper bound

A function f(N) that is ≥ the worst case T(N), for all values of N ≥ 1.

92
New cards

Asymptotic notation

The classification of runtime complexity that uses functions that indicate only the growth rate of a bounding function. Three notations are commonly used in complexity analysis:

O - Growth rate for an algorithm's upper bound.

Ω - Growth rate for an algorithm's lower bound.

Θ - Growth rate that is both an upper and lower bound.

93
New cards

worst-case runtime

The runtime complexity for an input that results in the longest execution.

94
New cards

Fibonacci sequence

A numerical sequence where each term is the sum of the previous 2 terms in the sequence, except the first 2 terms, which are 0 and 1.

95
New cards

recurrence relation

A function f(N) that is defined in terms of the same function operating on a value < N.

96
New cards

recursion tree

A visual diagram of a operations done by a recursive function, that separates operations done directly by the function and operations done by recursive calls.

97
New cards

Linear search

A search algorithm that starts from the beginning of a list, and checks each element until the search key is found or the end of the list is reached.

98
New cards

Selection sort

A sorting algorithm that treats the input as two parts, a sorted part and an unsorted part, and repeatedly selects the proper next value to move from the unsorted part to the end of the sorted part.

99
New cards

insertion sort

A sorting algorithm that treats the input as two parts, a sorted part and an unsorted part, and repeatedly inserts the next value from the unsorted part into the correct location in the sorted part.

100
New cards

nearly sorted

When a list only contains a few elements not in sorted order.