1/31 Flashcards

(12 cards)

1
Q

Tree vs Graph

A

Tree: each node has only one parent. Root node is ancestor of all nodes.

Graph or cycle: node can have multiple parents

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

Binary Tree

A

Each node has up to 2 children.

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

Edges

A

Nodes are connected by edges.
A tree with n nodes has n-1 edges

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

Level

A

Represents a node’s heirarchy

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

Root

A

Single node at the top level

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

Children

A

The nodes at each successive level of a tree ate the children of the nodes at the previous level

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

Parent

A

A node that has children is the parent of those children

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

Leaf

A

A node that has no children

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

Subtree

A

Any node and its descendants form a subtree of the OG tree. Must include all descendants.

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

Interior node

A

Non-leaf nodes (parent and has children)

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

Class

A

A data structure where all instances share the same attributes and uses

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

What is the point of OOP

A

We do not have to change the code every time we want to add/remove a similarly structured “object”. This is why we have classes for REUSABILITY.

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