Finals: Data Structures and Algorithms 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(____);

A

root

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>

A

2 and 4

22
Q

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

A

C:

23
Q

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

A

a = set()

24
Q

This operation retrieves the common elements between two sets.

A

intersection

25
Q

Which Python statement determines the elements present in set2 that are missing in set1?

A

set2 - set1

26
Q

It is a measure of a node’s distance from its root.

A

level

27
Q

In this sorting type, the smallest unsorted item is chosen and then swapped with the item in the next position to be filled.

A

selection sort

28
Q

What is the process of visiting all the nodes in a specific order?

A

traversal

29
Q

This is the sequence of adjacent vertices.

A

path

30
Q

Which package contains the PriorityQueue class?

A

java.util

31
Q

The implementation of the Fibonacci uses which type of recursion?

A

binary

32
Q

Which part of a node contains the address of the next node?

A

pointer field

33
Q

Which Java package contains the queue interface?

A

java.util

34
Q

ArrayList val = new ArrayList();
Collections.______(val, 2, 4, 3);
Collections.sort(val);

A

addAll

35
Q

The machine in this model is provided with labeled data.

A

reinforcement learning

36
Q

Identifying whether an e-mail is a spam or not is an example of which machine learning model?

A

unsupervised learning