import java.util.*; import java.io.*; class Test { public static class MinHeap{ int arr[]; int size; int capacity; MinHeap(int c){ size = 0; capacity = c; arr = new int[c]; } int left(int i) { return (2*i + 1); } int right(int i) { return (2*i + 2); } int parent(int i) { return (i-1)/2; } } public static void main(String args[]) { MinHeap h=new MinHeap(11); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter