← 回題庫

卷別

資料結構與演算法

選擇

國立臺灣大學 2026 · 考試 · 第 10 題

(4 points) Consider an array [4,5,1,10,2,7][4, 5, 1, 10, 2, 7], if Build-Max-Heap\textsc{Build-Max-Heap} (bottom-up heapify) is performed, a process that converts the array into a max-heap by adjusting elements starting from the bottom non-leaf nodes and working up to the root. What is the resulting array?

  • (A)
    [10,5,7,4,2,1][10, 5, 7, 4, 2, 1]
  • (B)
    [10,7,5,4,2,1][10, 7, 5, 4, 2, 1]
  • (C)
    [7,5,4,10,2,1][7, 5, 4, 10, 2, 1]
  • (D)
    [10,7,5,2,1,4][10, 7, 5, 2, 1, 4]
  • (E)
    None of the other choices.

標準解析

AI 已複查