資料結構›Ch7 搜尋與排序
第 33 題/共 76 題
◀ DS 33/76
33. Min Heap、Insert、Percolate Up
#DS-07-033中Min HeapInsertPercolate Up

(3%) Considering the following implementation of min heap, which way of filling in the code to make function insert work correctly?

#define MAX_SIZE 10
int data[MAX_SIZE];
int size=0;
void insert(int x)
{
  if (size>=MAX_SIZE-1)  return;
  int cur= □□ ;
  while(cur!=0 && data[◇◇]>x) {
    data[cur]=data[◇◇];
    cur= ◇◇;
  }
  data[cur]=x;
}
📄 交大114
跳轉到第題
▤完整推導請見《WH 資工筆記 · 資料結構》Ch7 搜尋與排序
本章題號 · 21–40 / 76