Trees & Graphs Flashcards

1
Q

Binary Tree vs. Binary Search Tree

A

A binary search tree is a binary tree in which every node fits a specific ordering property: a l l l e f t descendents <= n < a l l r i g h t descendents. This must be true for each node n.

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

Balanced vs. Unbalanced

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

Complete Binary Trees

A

A complete binary tree is a binary tree in which every level of the tree is fully filled, except for perhaps the last level. To the extent that the last level is filled, it is filled left to right,

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

Full Binary Trees

A

A full binary tree is a binary tree in which every node has either zero or two children. That is, no nodes have only one child.

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

Perfect Binary Trees

A

A perfect binary tree is one that is both full and complete. All leaf nodes will be at the same level, and this level has the maximum number of nodes.

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

Binary Tree Traversal

A

InOrder (izquierda, raiz, derecha)
PreOrder (raiz, izquierda, derecha)
PostOrder (izquierda, derecha, raiz)

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

Binary Heaps (Min-Heaps and Max-Heaps)

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

Min-heap

A

A min-heap is a complete binary tree (that is, totally filled other than the rightmost elements on the last level) where each node is smaller than its children. The root, therefore, is the minimum element in the tree.

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

Min-heap operations

A

insert
extract minimun element

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

Tries (Prefix Trees)

A

A trie is a variant of an n-arytree in which characters are stored at each node. Each path down the tree may represent a word.

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

Graphs

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

Graph Search

A

Depth-First Search
Breadth-First Search

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

Depth-First Search (DFS)

A

visit a node a and then iterate through each of a’s neighbors.

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

Breadth-First Search (BFS)

A

visits each of a’s neighbors before visiting any of their neighbors.

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