阿摩線上測驗 登入

申論題資訊

試卷:109年 - 109國立臺灣大學_碩士班招生考試_資訊工程學研究所:資料結構與演算法(A)#106053
科目:台大◆資工◆資料結構與演算法(A)
年份:109年
排序:0

題組內容

 Please Turn Over (there are mo ore questions on the next pages).
Answer the following questions in details.
11. (5 points) Given an array of n integers A = (a1, a2,.., an) (n > 0), you are asked to find the maximum and minimum elements with minimum comparisons. A simple solution is to iteratively compare each element with current max and min. It takes 2n comparisons in total.

申論題內容

(a) (3 points) Devise an algorithm that requires less than 1.67n comparisons.