Data Rep Flashcards

(33 cards)

1
Q

What is a Hash Table?

A

A data structure where a hashing algorithm creates a mapping between keys and values.

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

How can data items in a Hash Table be accessed?

A

By recalculation, without any search.

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

What is the defining characteristic of a Queue?

A

A first-in-first-out (FIFO) data structure.

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

In a Queue, what happens to the first item added?

A

It is the first to be removed.

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

What is the defining characteristic of a Stack?

A

A last-in-first-out (LIFO) data structure.

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

In a Stack, what happens to the last item added?

A

It is the first to be removed.

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

What is a Static Structure?

A

A data structure that is allocated a fixed amount of memory space.

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

What is the purpose of Trees in data structures?

A

To form a hierarchical structure starting at a root node.

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

What is a Vector in data structures?

A

A data structure representing a quantity with both magnitude and direction.

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

What does the Peek/Top operation do in a Stack?

A

Allows the user to view the top element of the stack without modifying it.

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

What does the Pop operation do in a Stack?

A

Removes the most recently added element that was not yet removed.

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

What does the Push operation do in a Stack?

A

Adds an element to the top of the stack.

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

What is an Adjacency List in graph representation?

A

A representation that stores a list of connected nodes to each node.

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

What is an Adjacency Matrix?

A

A matrix representation of a graph that stores the edges connecting all possible nodes.

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

True or False: In Directed Graphs, the order of vertices paired in an edge does not matter.

A

False

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

What is an Edge/Arc in graph structures?

A

A connection that represents a relationship between two nodes.

17
Q

What is the characteristic of Undirected Graphs?

A

The order of the vertices paired in an edge does not matter.

18
Q

What does the term Vertex/Node refer to in a graph?

A

The representation of an object on a graph that is capable of being related to others.

19
Q

Advantages off an adjacency matrix?

A

Stores every possible edge between nodes, even those that don’t exist. Almost half of the matrix is repeated data. Memory inefficient.

Allows a specific edge to be queried very quickly, as it can be looked up by its row and column.

20
Q

Disadvantages of an adjacency list

A

Only stores the edges that exist in the graph. Memory efficient.

Slow to query, as each item in a list must be searched sequentially until the desired edge is found.

21
Q

What is a tree in graph theory?

A

A tree is a connected, undirected graph with no cycles.

22
Q

What data structure does depth-first traversal use?

A

Depth-first traversal uses a stack.

23
Q

What is depth-first traversal commonly used for?

A

Depth-first traversal is used for navigating a maze.

24
Q

Can a depth-first algorithm be performed on structures other than trees?

A

Yes, a depth-first algorithm can be performed on any connected graph.

25
What data structure does Breadth-First Search use?
Breadth-first traversal uses a queue.
26
On what type of graph does Breadth-First Search work?
This algorithm will work on any connected graph.
27
What is a key use of Breadth-First Search?
Breadth-first traversal is useful for determining the shortest path on an unweighted graph.
28
What is in-order traversal?
In-order traversal is a method used for binary trees.
29
What is the main use of in-order traversal?
It is useful for a binary search tree and outputs the contents in ascending order.
30
Can in-order traversal be performed on any type of tree?
No, it can only be performed on binary trees.
31
What is Post-Order Traversal?
Post-order traversals can be performed on any tree.
32
What are the uses of Post-Order Traversal?
They are useful for Infix to RPN (Reverse Polish Notation) conversions, producing a postfix expression from an expression tree, and emptying a tree.
33
What is the first step in a pre-order traversal of a tree?
The first step is to mark the left hand side of each leaf.