Vocab Flashcards

1
Q

Preorder (Depth-first)

A

visit a node and then visit the subtrees rooted at each of its children recursively. a.k.a. Depth First traversal.

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

Postorder

A

recursively visit the subtrees rooted at each child of a node and then visit the node.

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

Breadth - first

A

visit all nodes at depth d before visiting nodes at depth d + 1.

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

Inorder

A

Definition: limited to binary tree - recursively visit left child, root, right child

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

Binary Tree

A

An ordered tree wherein every node has at most 2 children, so either child is either left or right

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

Binary Search Tree

A

Each node stores a key-value pair. For a given parent, the left child (and the entirety of its subtree) is logically less, and the right child (and the entirety of its subtree) is logically more.

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

Trie

A

Tree nodes consist of an array of R == alphabet size slots, and a value. Mid-key node will hold link to next node in appropriate alphabet slot, and a null value, final key node will not hold no link, and the corresponding value.

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

Heap

A

Complete binary tree wherein the key of every node is greater than or equal to the key of its children (Heap-Order Property)

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

2-3 Tree

A

Tree consisting of 2-nodes (one key, left-link and right-link), and 3-nodes (two keys, left-link, middle-link, right-link).

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

Red-Black Tree

A

Definition: Binary search tree implementation, strictly consisting of 2-nodes, that conceptually mirrors 2-3 trees (red links represent horizontal, as opposed to vertical links; ie 2 red-linked 2-nodes = 3-node). Red links must lean to the left, can’t have consecutive red links.
Features/Advantages: Insertion guarantees perfect black balance, and with it near O(logn) search. Nearly as effective as 2-3 Tree, much easier to implement.

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

B-Tree

A

Tree wherein every entry e with key k in an internal node has a link to a child node which is the root of a subtree wherein all keys >= k and < the next entry’s key in the same node as e

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

Root

A

First node in a tree, no parent node, only children.

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

Acyclic

A

There is exactly one path connecting any two nodes in a tree

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

Path

A

A sequence of nodes such that any two consecutive nodes in the sequence from an edge

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

Ancestor

A

A node reachable by repeatedly proceeding from child to parent

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

Descendent

A

A node reachable by repeatedly proceeding from parent to child

17
Q

Depth

A

The number of nodes on the path from the node to the root, including the node itself

18
Q

Height

A

Height of node V is: if V is a leaf, height == 0, else height = maximum height of its children + 1

19
Q

Internal

A

A node with at least one child

20
Q

Leaf/external

A

A node with no children

21
Q

Edge

A

A pair of nodes, U, V, such that one is a the parent of the other

22
Q

Ordered

A

A tree is ordered if there is a meaningful linear order among the children of every node

23
Q

Isomorphic

A

Two ordered trees T’ and T’’ are Isomorphic if the following recursive definition is true: Both have no children OR the roots of T’ and T’’ have the same number of children/subtrees (k), and for i = 0,…,k the ith such subtree of T’ has the same number of child subtrees as the ith such subtree of T’’

24
Q

Proper binary tree

A

Every node has either 0 or 2 children

25
Q

Complete Binary Tree

A

Every level, except the last, must be completely filled and all nodes are as far left as possible

26
Q

Trie node

A

node consisting of an array of links corresponding to alphabet of key set, value

27
Q

2 - Node

A

Node with one key, two child links (left,right)

28
Q

3 - Node

A

Node with two keys, three child links (left, middle, right)

29
Q

4 - Node

A

Node with three keys, four child links(Left, left-middle, right-middle, right). Only temporary in 2-3 Tree; meant to be converted into 3, 2 Nodes

30
Q

Rotation

A

Step to balance left-leaning Red-Black Tree with right -leaning red link

31
Q

Color flip

A

Step to balance left-leaning Red-Black Tree with two red links stemming from a single parent.

32
Q

Perfect Balance

A

condition of a 2-3 tree and Red-Black tree that all null links must be the same distance (have the same depth) to the roots