BST Flashcards

(12 cards)

1
Q

Balanced

A

A binary tree is balanced only if the height of any given node’s right subtree and left subtree differ by no more than 1

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

height

A

The height of a node is the number of nodes from the root to the deepest leaf.
The height of a tree is a height of the root.

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

size

A

number of nodes

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

complete

A

A complete binary tree is a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible

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

proper

A

A Proper binary tree.is a binary tree in which each node has exactly zero or two children.

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

Max Heap

A

heap is a binary tree (not a bst)
complete at all times, so insert left to right without comparison

Max heap the parent is bigger and min heap the parent is smaller.

first insertion is to the left because it’s complete at all times, second is to the right for the same reasons and so on, there’s no comparison for insertion

after each insertion you check if the parent is the min/max constraint is satisfied, if not, swap them

After a swap check the constraint again and swap again until the constraint is satisfied

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

AVL left rotation

A

see AVL folder

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

AVL Right Rotation

A

see AVL folder

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

AVL Left-right

A

See AVL Folder

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

AVL Right Left

A

see AVL Folder

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

Full

A

A Full binary tree.is a binary tree in which each node has exactly zero or two children AND the leaves are all on the same level, IE proper, balanced, and complete

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

inorder, preorder, postorder

A

Inorder: left, root, right
preorder: Root, left, right
Postorder: left, right, post

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