資料結構›Ch7 搜尋與排序
第 61 題/共 76 題
◀ DS 61/76
61. Min-Heap、Priority Queue、Extract-Min、Insert
#DS-07-061易Min-HeapPriority QueueExtract-MinInsert

[2%, 2%, 2%] A job priority queue is implemented using a Min-Heap in which a lower key value represents a higher priority. The jobs are entered and stored in the Min-Heap as shown in the following array QQ.

index012345678910
key value--681012241513201826

(i) [Step 1] Next job is extracted from the job queue for execution. What is the value of Q[4]Q[4] in the remaining job queue? (A) 15 (B) 18 (C) 20 (D) 26 (E) None of the above

(ii) [Step 2] After Step (1) is executed, next job is extracted from the job queue for execution. What is the value of Q[5]Q[5] in the remaining job queue? (A) 13 (B) 15 (C) 18 (D) 24 (E) None of the above

(iii) [Step 3] After step (2) is executed, a new job with priority 11 is inserted into the job queue. What is the value of Q[9]Q[9] in the remaining job queue? (A) 18 (B) 20 (C) 24 (D) 26 (E) None of the above

📄 成大111
跳轉到第題
▤完整推導請見《WH 資工筆記 · 資料結構》Ch7 搜尋與排序
本章題號 · 61–76 / 76