Trees Flashcards

1
Q

A non-linear data structure that consists of nodes
and is connected by edges with a hierarchical
organization

A

Trees

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

The nodes in a tree are arranged in a ________________

A

parent-child
relationship

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

The topmost node in a tree is called the ______

A

root node

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

It contains some data and
may have references to its child nodes.

A

Node

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

Each element in tree

A

Node

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

the first node of the tree. And is the initial node of the tree in data structures.

A

Root

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

T or F

In the tree data structure, there must be only one root node.

A

T

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

Represents a connection between two nodes. It defines the relationship between a parent node and its child node. A line connecting the nodes.

A

Edge

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

A node that has one or more child nodes. It is located above its child nodes in the hierarchy.

A

Parent

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

A node that has a parent node. It is located below
its parent node in the hierarchy.

A

Child

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

Nodes that share the same parent. They are at
the same level in the tree.

A

Siblings

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

A node that does not have any child nodes.
It is
also known as a terminal node.

A

Leaf

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

Nodes that have one or more child
nodes. They are neither leaf nodes nor the root node.

A

Internal Nodes

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

the total number of children of a node.

A

DEGREE

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

The
highest degree of the node among all the nodes in a tree.

A

Degree of Tree

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

the distance of a node from the root.

A

LEVEL

17
Q

The number of edges from the leaf node to the
particular node in the longest path is known as the height
of that node.

A

Height

18
Q

the height of the root node

A

“Height of Tree”.

19
Q

many edges from the root node to the particular
node

A

Depth

20
Q

In the tree, the total
number of edges from the root node to the leaf node in
the longest path

A

“Depth of Tree”.

21
Q

the sequence of nodes and edges from one node to another node is called the path between those two
nodes. The length of a this is the total number of nodes in this.

A

PATH

22
Q

TYPES OF TREES:

A

• GENERAL TREE:
• BINARY TREE:
• BINARY SEARCH TREE:
• AVL TREE:
• B-TREE:

23
Q

Properties
It follows all properties of the tree data structure.

A node can have any number of nodes.

A

GENERAL TREE:

24
Q

Properties
Follows all properties of the tree data structure.

It can have at most two child nodes.

These two children are called the left child and the right child

A

BINARY TREE

25
Q

Properties
Left node value<= root node <= right node value
Follows all properties of the tree data structure

has a unique property known as the binary search property.

A

BINARY SEARCH TREE

26
Q

Properties
Follows all properties of the tree data structure.

Self-balancing.

Each node stores a value called a balanced factor, which is the difference in the height of the left sub-tree and right sub-tree.

All the nodes in the ________ must have a balance factor of -1, 0, and 1.

A

AVL TREE: (Georgy Adelson-Velsky and Landis - inventor)

27
Q

Properties
is a special kind of self-balancing search tree in which each node can contain more than one key and can have more than two children.

is also known as a height-balanced m-way tree.

A

B-TREE

28
Q

• a process of visiting each node and prints their value.

A

TREE TRAVERSAL

29
Q

LRN

A

Post-Order Traversal

30
Q

LNR

A

In-Order Traversal

31
Q

NLR

A

Pre-Order Traversal

32
Q

Can construct a unique binary tree from pre-order and Post-Order

A

Cannot!

33
Q

Can construct a unique binary tree from In-Order and Pre-Order ?

A

Can

34
Q

Can construct a unique binary tree from In-Order and Post-Order?

A

Can