u3 Flashcards

1
Q

The three laws of recursion:

A
  • A recursive algorithm must have a base case.
  • A recursive algorithm must change its state and move towards the base case.
  • A recursive algorithm must call itself
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

binary tree

A

a tree in which each node has a maximum of two children and each child of a node is designated as the left or right child

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

Preorder

A

root, then left subtree,then right subtree.

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

Inorder:

A

left subtree, then root, then right subtree.

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

complete binary tree

A

a binary tree in which all parents have two children, except for the parents of children at the bottom level of the tree. At the bottom level, all nodes must be as far to the left as possible.

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

binary heap

A

a complete binary tree with an ordering rule (the heap order property) which states that parent nodes are either less than or equal to their children (a min heap) or greater than or equal to their children (a maxheap).

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

Heapifying

A

the process of creating a binary heap from a list.Heapifying is possible in O(n) time.

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