What is Heap Data StructureIts a tree based data structure which is a complete binary tree(all nodes have…