CS301A's Finals: Data Structrs. & Algrthms. Flashcards

For finals exams.

1
Q

It is a special format for storing and organizing data.

A

data structure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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.

A

abstract data type (ADT)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

An ADT used for storing elements where each is a separate object.

A

linked list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

An ordered list in which the last element added is the first element retrieved or removed (Last-In, First-Out).

A

stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

An ordered list in which the first element added is the first element retrieved or removed (First-In, First-Out).

A

queue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

It represents a hierarchical nature of a structure in a graphical form.

A

tree

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A special type of ordered list where elements are processed based on their order (natural or custom).

A

priority queue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

A complete binary tree where the value of each parent node is either higher or lower than the value of its child nodes.

A

heap

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A collection of elements where each element is unique.

A

set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A set of ordered pairs where elements are known as keys (identifiers) and values (content).

A

map

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Consists of a set of vertices (or nodes) and a set of edges (relations) between the pairs of vertices.

A

graph

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

In this sorting type, the list is divided into sorted sublists then combined into a single sorted list.

A

bubble sort

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which best describes a linear recursion?

A

Only a single call is made from within the function each time it runs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

val = [2, 4, 3];
___.sort();

A

val

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What occurs when a method calls another method that eventually calls itself?

A

indirect recursion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What happens during the Divide and Conquer paradigm?

A

A problem is broken down into smaller subproblems.

17
Q

A self-driving car is an example of which machine learning model?

A

reinforcement learning

18
Q

DefaultMutableTreeNode root = new DefaultMutableTreeNode(“M”);
JTree tree = new JTree(____);

19
Q

Weather forecasting is an example of which type of machine learning model?

A

supervised learning

20
Q

The machine in this model learns from a dataset that includes both labeled and unlabeled data.

A

semi-supervised learning

21
Q

ArrayList<Integer> minHeap = new ArrayList<>();
Collections.addAll(minHeap, 2, 4, 5, 7, 8);
Which are the parent nodes?</Integer>

22
Q

C:\Users\bpena\Desktop\Midterm
Which represents the root node in the given file path?

23
Q

What does a line of code that creates an empty set in Python look like?

24
Q

This operation retrieves the common elements between two sets.

A

intersection

25
Which Python statement determines the elements present in set2 that are missing in set1?
set2 - set1
26
It is a measure of a node's distance from its root.
level
27
In this sorting type, the smallest unsorted item is chosen and then swapped with the item in the next position to be filled.
selection sort
28
What is the process of visiting all the nodes in a specific order?
traversal
29
This is the sequence of adjacent vertices.
path
30
Which package contains the PriorityQueue class?
java.util
31
The implementation of the Fibonacci uses which type of recursion?
binary
32
Which part of a node contains the address of the next node?
pointer field
33
Which Java package contains the queue interface?
java.util
34
ArrayList val = new ArrayList(); Collections.______(val, 2, 4, 3); Collections.sort(val);
addAll
35
The machine in this model is provided with labeled data.
reinforcement learning
36
Identifying whether an e-mail is a spam or not is an example of which machine learning model?
unsupervised learning