What's the relationship between “a” heap and “the” heap?

前端 未结 9 1367
遇见更好的自我
遇见更好的自我 2020-12-05 02:31

A heap is a tree data structure where higher levels of the tree always contain greater (or lesser, if it\'s set up that way) values than lower levels. \"The\" heap is a bun

相关标签:
9条回答
  • 2020-12-05 02:58

    They both have the same name, that's about it.
    There 'the heap' is never arranged as an actual heap data structure.

    0 讨论(0)
  • 2020-12-05 03:06

    They...have the same name! That's it.

    0 讨论(0)
  • 2020-12-05 03:09

    The heap (datastructure) is called like that because if you draw it it looks like a heap. The heap (memory) is called a heap because it is somehow organized but not fully. You accumulate data on a heap but you might have holes in it and irregularities. It's as if you'd put papers on a heap. Sometimes you remove one from the bottom. This has a form of a heap, i.e. somehow organized but not fully.

    0 讨论(0)
提交回复
热议问题