M AT L A B是一個可視化的計算程序,被廣泛地使用于從個人計算機到超級計算機范圍內
的各種計算機上。
M AT L A B包括命令控制、可編程,有上百個預先定義好的命令和函數。這些函數能通過
用戶自定義函數進一步擴展。
M AT L A B有許多強有力的命令。例如, M AT L A B能夠用一個單一的命令求解線性系統,
能完成大量的高級矩陣處理。
M AT L A B有強有力的二維、三維圖形工具。
M AT L A B能與其他程序一起使用。例如, M AT L A B的圖形功能,可以在一個 F O RT R A N
程序中完成可視化計
附錄 光盤說明\r\n本書附贈的光盤包括各章節實例的設計工程與源碼,所有工程在下列軟件環境下運行通過:\r\n? Windows XP SP2\r\n? MATLAB\r\n? Altera Quartus II \r\n? synplify8.4\r\n? modelsim_ae6.1\r\n\r\n光盤目錄與實例名稱的對應關系如下:\r\n\r\n cht02文件夾中存放的是書中第2章中的例子,讀者可以將一些簡單例子的代碼 \r\n拷貝到MATLAB命令窗口進行運行,也可以把
Input : A set S of planar points
Output : A convex hull for S
Step 1: If S contains no more than five points, use exhaustive searching to find the convex hull and return.
Step 2: Find a median line perpendicular to the X-axis which divides S into SL and SR SL lies to the left of SR .
Step 3: Recursively construct convex hulls for SL and SR. Denote these convex hulls by Hull(SL) and Hull(SR) respectively.
Step 4: Apply the merging procedure to merge Hull(SL) and Hull(SR) together to form a convex hull.
Time complexity:
T(n) = 2T(n/2) + O(n)
= O(n log n)