max_heapify procedure on heap

后端 未结 5 641
無奈伤痛
無奈伤痛 2021-01-22 02:27

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         


        
5条回答
  •  后悔当初
    2021-01-22 03:17

    The function max_Heapify always recurses infinitely. You are seeing a stack overflow (small s, small o).

    If you step through your code in the debugger, this sort of thing will quickly be obvious.

提交回复
热议问题