سؤال

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