Data Structures and Algorithms Flashcards

1
Q

An ordered list in which the last element is added is the first element retrieved or removed. (LILO)

A

Stack

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

Adds an item to the top of the stack.

A

Push

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

Removes an item from the top of the stack.

A

Pop

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

Looks at the item at the top of the stack without removing it from the stack.

A

Peek (Java)
stack_name[-1] (Python)

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

Test whether the stack is empty.

A

isEmpty() (Java)
if not (Python)

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

A string that reads the same in either direction.

A

Palindrome

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

An ordered list in which the first element added is the first element to be retrieved or removed. (FIFO)

A

Queue

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

Adds an item into the queue.

A

Enqueue

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

Removes the head of the queue.

A

Dequeue

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

Retrieves the head of the queue. (Python)

A

Peek

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

Tests whether the queue is empty. (Python)

A

if not

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

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
13
Q

Top of a tree.

A

Root

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

Successor of a node.

A

Child nodes

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

The predecessor of a node.

A

Parent

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

A tree is considered a ___ if all its nodes have two (2) child nodes at most.

A

Binary tree

17
Q

Nodes that have the same parent.

A

Siblings

18
Q

A node that has no child nodes.

A

Leaf node or external node

19
Q

A tree within a tree.

A

Subtree

20
Q

A measure of a node’s distance from the root.

A

Level

21
Q

The highest level of a tree.

A

Depth

22
Q

The number of child nodes in a subtree.

A

Degree

23
Q

The process of visiting all the nodes in a specific order.

A

Traversal

24
Q

Nodes are visited by level.

A

Breadth-First or Level Order

25
Q

A Java Swing component that displays a set of hierarchical data as an outline.

A

JTree

26
Q

This Java class is used to represent a general-purpose node in a tree data structure.

A

DefaultMutableTreeNode

27
Q

This method removes a node from its parent and makes it a child of another node by adding it to the end of that node’s child array.

A

add()

28
Q
A