QUESTION
Given a Binary Search Tree, convert it into a Min-Heap containing the same elements in O(n) time. Do this in-place.\n\nInput: Binary Search Tree\n 8\n / \\\n 4 12\n / \\ / \\\n 2 6 10 14\n\n\nOutput – Min Heap\n 2\n / \\\n 4 6\n / \\ / \\\n8 10 12 14\n[Or any other tree that follows Min Heap\n properties and has same keys].
ANSWER
#include <stdio.h>
int main()
{
printf("2 \n");
printf("4 6 \n");
printf("8 10 12 14 ");
return 0;
}