vector<int> v[HMAX];

Fill(ar,0,n-1,0);//main() call

void Fill(int ar[],int start,int end,int idx)
{
        if(start>end)return;

        v[idx].push_back(ar[start]);
        Fill(ar,start+1,(end+start)/2,idx+1);
        Fill(ar,(end+start)/2+1,end,idx+1);
}

ar[] is input array/
v contains elements in level order indexed in vector.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to