I am currently taking a university course in data structures and algorithms, and the course material seems to include some faulty definitions. I wasn't able to have a constructive conversation with the module instructor and I am unsure whether I am mistaken about the definitions or the course material is wrong. Can you please evaluate the course content and my comments about them below?
Course Content: A heap is the name of the structure that represents an almost complete binary tree; that is, a binary tree that is complete in all levels except maybe the leaf level, and that level is completed staring from the left. You might remember that we talked about Complete binary trees in Unit 1. Complete and almost complete binary trees are very similar, in that both of them are complete in all levels except the leaf level, and that level needs to be completed starting from the left. However, in a complete binary tree we have one more requisite to satisfy: all the leaves must be in the same level. This is not the case with almost complete binary trees.
My Comments: The defining characteristic of a heap is its heap property, which defines a specific relationship between parent nodes and their children. Although heaps are often implemented as "almost complete" binary trees for efficiency, this shape alone does not define a heap. I also find it difficult to reconcile this definition with alternative structures like skew heaps and Fibonacci heaps. The definition above seems to define a Binary Heap. Furthermore, in regards to the binary tree distinction mentioned, the terms "complete" and "almost complete" binary trees are often used interchangeably, and the leaf-level distinction does not apply to either.
Node Height as Defined by the Instructor: The height of a node is how far away it is from the root.
My Comments: This definition actually refers to the 'level' or 'depth' of a node, not its height. The height of a node is determined by the deepest level of the subtree starting from that node.
A claim that says, instead of using linear search and a counter, dividing the array into subarrays and comparing their values is more efficient.
