鄰接矩陣類的根是A d j a c e n c y W D i g r a p h,因此從這個類開始。程序1 2 - 1給出了類的描述。程 序中,先用程序1 - 1 3中函數Make2DArray 為二組數組a 分配空間,然后對數組a 初始化,以描述 一個n 頂點、沒有邊的圖的鄰接矩陣,其復雜性為( n2 )。該代碼沒有捕獲可能由M a k e 2 D A r r a y 引發的異常。在析構函數中調用了程序1 - 1 4中的二維數組釋放函數D e l e t e 2 D
標簽: 矩陣
上傳時間: 2013-12-21
上傳用戶:lanjisu111
在sco unix 下顯示前n天或后n天日期的處理程序。 printf("功能: 時間戳與時間格式字符串的轉換程序\n") printf(" -i 輸入的參數為時間戳\n") printf(" -s 輸入的參數為格式化時間\n") printf(" -t 輸入的時間取當前系統時間\n") printf(" -x 輸入的時間增加或減少的天數\n") printf(" -o 輸出的時間為時間戳格式\n") printf(" -O 輸出的時間為格式化時間\n") printf(" -h 幫助文件-查看[format]如何定義,例 %s -h\n",procname) printf("范例:1 取當前日期的前2天的時間顯示 %s -t -x -2\n",procname) printf(" 2 取20030101的前5天的時間顯示 %s -s 20030101000000 -x -5\n",procname) printf(" 3 取20031231的后5天的時間顯示 %s -s 20031231000000 -x 5 -O \"%%D %%T\"\n",procname) printf(" 4 取時間戳為1089619417的時間顯示 %s -i 1089619417 \n",procname) printf(" 5 取時間戳為1089619417的后4天的時間顯示 %s -i 1089619417 -x 4 \n",procname)
上傳時間: 2015-10-17
上傳用戶:TRIFCT
HDOJ ACM input:The input consists of T test cases. The number of test cases ) (T is given in the first line of the input. Each test case begins with a line containing an integer N , 1<=N<=200 , that represents the number of tables to move. Each of the following N lines contains two positive integers s and t, representing that a table is to move from room number s to room number t (each room number appears at most once in the N lines). From the N+3-rd line, the remaining test cases are listed in the same manner as above.
上傳時間: 2015-10-18
上傳用戶:三人用菜
處理程序,在使用單片機作為控制cpu時,請稍作簡化,具體的PID參數必須由具體對象通過實驗確定。由于單片機的處理速度和ram資源的限制,一般不采用浮點數運算,而將所有參數全部用整數,運算 到最后再除以一個2的N次方數據(相當于移位),作類似定點數運算,可大大提高運算速度,根據控制精度的不同要求,當精度要求很高時,注意保留移位引起的“余數”,做好余數補償。這個程序只是一般常用pid算法的基本架構,沒有包含輸入輸出處理部分。
上傳時間: 2013-12-19
上傳用戶:koulian
Input The first line of the input contains a single integer T (1 <= T <= 20), the number of test cases. Then T cases follow. The first line of each case contains N, and the second line contains N integers giving the time for each people to cross the river. Each case is preceded by a blank line. There won t be more than 1000 people and nobody takes more than 100 seconds to cross. Output For each test case, print a line containing the total number of seconds required for all the N people to cross the river. Sample Input 1 4 1 2 5 10 Sample Output 17
標簽: the contains integer number
上傳時間: 2015-10-27
上傳用戶:plsee
第一步:采用PID控制,在控制器啟動過程中,首先采用灰色估計器對不確定部分的模型參數建立GM(0,N) 模型進行估計,其中 控制算法為 第二步:按估計參數加上補償控制,估計器停止工作,灰色控制算法為
上傳時間: 2015-11-02
上傳用戶:天涯
AVR單片機入門及C語言高效設計實踐(六) ATMEAG16L的定時/計數器 ATMEAG16L有兩個8位定時/計數器(T/C0、T,C2)和一個16位定時/計數器T/C1)。每一個計數器都支持PWM(脈沖寬度調制)輸出功能。PWM輸出在電機控制、開關電源、信號發生等領域有著廣泛的應用。[第一段]
上傳時間: 2015-11-16
上傳用戶:集美慧
快速瞭解ECLIPSE 目錄 序言· 一.Eclipse 簡介 二.Eclipse 組織 三.Eclipse 相關術語 四.Eclipse 平臺 五.EMF & GEF 介紹 六.關於Eclipse、SWT 和JFace 一個SWT 應用程式的基礎材料 基本控制項 標籤 文件 按鈕 事件監聽器 複合控制項 Shell 佈局管理器 FillLayout GridLayout GridData 15 建立一個執行程式 為什麼使用SWT 七.OSGI 簡介 Eclipse 資源 附錄1 SWT 的內幕? 附錄2 相關網站 附錄3 外掛開發
上傳時間: 2015-11-30
上傳用戶:cc1
我的查表算法思路是這樣的 : 1、構造N個二維數組(N=你需要輸入的最大頻率值位數,例如你需要精確到10HZ,最高30MHZ,那么就有10M位、1M位、100K位、10K位、1K位、100HZ位、10HZ位,共7位,所以N=7)。 2、根據你所用的芯片型號,和晶振頻率,計算出每個頻率位0-9時的控制字。 3、使用時,把你頻率的每一位控制字,查表讀出,并相加(特別需要注意進位也需要處理)。 4、把加出的4字節控制字,送DDS。
上傳時間: 2015-12-21
上傳用戶:zjf3110
用遞推法產生正交多項式系,即求alpha[j+1]、beta[j] 入口參數:m是數據點數,n是擬合的最高階數, float x[],float y[]是對應縱橫坐標,出口參數:a[] 是最小二乘擬合參數,alpha[]、beta[]是遞推系數
上傳時間: 2014-01-19
上傳用戶:gyq