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

前端 未结 9 1393
遇见更好的自我
遇见更好的自我 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 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.

提交回复
热议问题