Problem I have implemented a max-Heap data structure backed by an array. I wanted to know whether this is an […]
Tag: heap
MinHeap implementation
Problem Please comment on this. class MinHeap<T> where T: IComparable { List<T> elements; public MinHeap() { elements = new List<T>(); […]
Continuous median in Ruby
Problem I have written a program in Ruby which calculates the median of a streaming set of numbers dynamically. For […]
MaxHeap implementation in JavaScript
Problem Here is MaxHeap implementation in pure JavaScript: /** * We initialize index 0 because, calculations for finding * children […]
Min & Max heap implementation
Problem As follows I have implemented Min and Max heap data structure, using an array for storing elements. I would […]
Min Heap Priority Queue
Problem This was a part of one an assignment I found online and tried to solve it myself. The objective […]
Python 3 implementation of binary heap
Problem Inspired by exercise on HackerRank where I’m expected to implement binary heap with additional method that allows to remove […]
Binary Min Heap data structure implementation
Problem After reading about heap I tried to implement the heap. Below is my code along with test. Any feedback […]
Implementation of Heap Sort
Problem Is this the correct implementation of Heap Sort using Java? How can it be improved further? import java.util.Arrays; public […]
Binary Heap Implementation in Java
Problem Here’s my array-based binary heap java implementation, looking for comments / suggestions on my approach. I used a base […]