L2-012 關於堆的判斷(基本的堆操作)

輸入樣例: 5 4 46 23 26 24 10 24 is the root 26 and 23 are siblings 46 is the parent of 23 23 is a child of 10 輸出樣例: F T F T 就是字符串處理很繁瑣別的還好。 找到自己的父親的方式,先找到自己的位置,哪一個i的heap[i]=x,i<<1對應的值就是父親的值 #include<cstdi
相關文章
相關標籤/搜索