i have these procedure
#include using namespace std; int parent(int i ){ return i/2; } int left(int i ){ return 2*i; } int right(i
Perhaps you shouldn't always call max_Heapify tail-recursively, but instead return when you've hit the bottom size of the sorting heap... What happens is that your program runs out of stack.
max_Heapify
Also, check out std::swap.
std::swap