設二維數組a[m n] 含有m*n 個整數
() 寫出算法(pascal過程或c函數)判斷a中所有元素是否互不相同?輸出相關信息(yes/no)
() 試分析算法的時間復雜度【華中理工大學 五 (分)】
二項式(a+b)n展開式的系數為
C(n)=C(nn)=對於n>=
C(nk)=C(nk)+C(nk)對於<k<n 形成著名的楊輝三角形如圖所示
()試寫一個遞歸算法根據以上公式生成C(nk)(分)
()試畫出計算C()的遞歸樹(分)
()試寫一個非遞歸算法既不用數組也不用棧對於任意的<=k<=n計算C(nk)(分)【清華大學 五 (分)】
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
From:http://tw.wingwit.com/Article/program/sjjg/201311/22761.html