Midterm Review Flashcards

(6 cards)

1
Q

What is a binary search tree?

A

A node based data structure. Looks a bit like a flow chart, except the bigger numbers are usually on the right side.

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

How is a binary search function done?

A

Usually by a recursive function. If the root node key is null, then what we are looking for does not exist.

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

How is binary insertion done?

A

We do the same thing as a search function, except if a node is null, there are loops to determine which node the data goes to.

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

How is binary deletion done?

A

If there is a node with no children, it’s simply removed. If there is a node with one child, the node is deleted and replaced with its child. If there is a node with two children, delete it base upon its children

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

What is a heap?

A

It is a set of data that is placed in an array

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

How is heap sort done?

A

The information is moved to a sorted and unsorted region of the array.

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