I was reading about heaps in Java programming. In my textbook, I found this definition of a heap: a heap is a complete binary tree with the following properties: 1) the value in the root is the smallest item in the tree; 2) every subtree is a heap
But when I was watching videos about heaps, I found a totally different definition of heaps which says: In a heap the parent keys are bigger then the children.
Now I am confused because the two definitions do not fit with each other. Which definition is the correct one?
Thanks!