Feb 06, 2019 22:38:02

# FT4 Heap

This is 4th post for in my post, Feynman Technique. Today I will write about "Heap", which is one of the topics that is asked for coding question I wrote here. Let me try to explain "Heap" as plain as possible.

### Tree

Before going to explain heap, we actually need to know "tree" based data structure, where each information is connected like a tree, which consists of 2 components: a node and an edge. This is very useful to explain the hierarchical relationship like country, state, and county.

For example, United States of America has 50 states. Each state has multiple counties. In this case, we can think of the following tree structure. The most left is the highest level in this tree.

USA - Alabama - County A

- County B

- Alaska     - County C

- County D

- County E

### Heap

So now let's go back to "Heap." "Heap" is a type of tree meeting with the following certain conditions:

1. each node has only but always two nodes
2. each node has a number information
3. a higher node has always bigger or always smaller number.

For example, there is a three-layer tree where each node has a number as below.

1 - 2 - 5
- 8
- 4 - 7
- 10

The top layer is the node with 1, which has two nodes meeting with Condition 1. All of the nodes has the number information, which meets with Condition 2. Last but not least, the higher node, 1 is bigger than either of nodes blongs to 1. The same rule can be applied for node 2 and 4 since their nodes has bigger values.

*****

Feynman techniques is working well. The decomposing the abstruse word into plain can be the process of understanding. In addition, I can remember more clearly what is the concept of topics. This could be a great chunk of drafts for my technical blog in the future if I continue to write like this.

Grammarly correction: 2

Word of the day: abstruse

contact: email - twitter / Terms / Privacy