質問

I read that the 'heap' is basically a binary tree. But this definition of Heap got me thinking about Java's Heap Space. Java's heap is a place where all the objects are created. But these objects surely are not sorted as per a binary tree? Because what would be the purpose of that?

役に立ちましたか?

解決

A binary heap is a heap data structure created using a binary tree while java heap is the memory used by JVM to manage the objects. You seems to be confused between these two concepts.

Datastructure such as PriorityQueue uses the binary heap tree concepts.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top