CS301A's Finals: Data Structrs. & Algrthms. Flashcards
For finals exams.
It is a special format for storing and organizing data.
data structure
It is a logical description of how data is viewed as well as the operations that are allowed without regard to how they will be implemented.
abstract data type (ADT)
An ADT used for storing elements where each is a separate object.
linked list
An ordered list in which the last element added is the first element retrieved or removed (Last-In, First-Out).
stack
An ordered list in which the first element added is the first element retrieved or removed (First-In, First-Out).
queue
It represents a hierarchical nature of a structure in a graphical form.
tree
A special type of ordered list where elements are processed based on their order (natural or custom).
priority queue
A complete binary tree where the value of each parent node is either higher or lower than the value of its child nodes.
heap
A collection of elements where each element is unique.
set
A set of ordered pairs where elements are known as keys (identifiers) and values (content).
map
Consists of a set of vertices (or nodes) and a set of edges (relations) between the pairs of vertices.
graph
In this sorting type, the list is divided into sorted sublists then combined into a single sorted list.
bubble sort
Which best describes a linear recursion?
Only a single call is made from within the function each time it runs.
val = [2, 4, 3];
___.sort();
val
What occurs when a method calls another method that eventually calls itself?
indirect recursion
What happens during the Divide and Conquer paradigm?
A problem is broken down into smaller subproblems.
A self-driving car is an example of which machine learning model?
reinforcement learning
DefaultMutableTreeNode root = new DefaultMutableTreeNode(“M”);
JTree tree = new JTree(____);
root
Weather forecasting is an example of which type of machine learning model?
supervised learning
The machine in this model learns from a dataset that includes both labeled and unlabeled data.
semi-supervised learning
ArrayList<Integer> minHeap = new ArrayList<>();
Collections.addAll(minHeap, 2, 4, 5, 7, 8);
Which are the parent nodes?</Integer>
2 and 4
C:\Users\bpena\Desktop\Midterm
Which represents the root node in the given file path?
C:
What does a line of code that creates an empty set in Python look like?
a = set()
This operation retrieves the common elements between two sets.
intersection