-
圖論中最小生成樹Kruskal算法 及畫圖程序 M-函數(shù)
格式 [Wt,Pp]=mintreek(n,W):n為圖頂點(diǎn)數(shù),W為圖的帶權(quán)鄰接矩陣,不構(gòu)成邊的兩頂點(diǎn)之間的權(quán)用inf表示。顯示最小生成樹的邊及頂點(diǎn), Wt為最小生成樹的權(quán),Pp(:,1:2)為最小生成樹邊的兩頂點(diǎn),Pp(:,3)為最小生成樹的邊權(quán),Pp(:,4)為最小生成樹邊的序號 附圖,紅色連線為最小生成樹的圖
例如
n=6 w=inf*ones(6)
w(1,[2,3,4])=[6,1,5] w(2,[3,5])=[5,3]
w(3,[4,5,6])=[5,6,4] w(4,6)=2 w(5,6)=6
[a,b]=mintreek(n,w)
標(biāo)簽:
mintreek
Kruskal
Wt
Pp
上傳時(shí)間:
2015-11-30
上傳用戶:dreamboy36
-
本題的算法中涉及的三個(gè)函數(shù):
double bbp(int n,int k,int l) 其中n為十六進(jìn)制位第n位,k取值范圍為0到n+7,用來計(jì)算16nS1,16nS2,16nS3,16nS4小數(shù)部分的每一項(xiàng)。返回每一項(xiàng)的小數(shù)部分。
void pi(int m,int n,int p[]) 計(jì)算從n位開始的連續(xù)m位的十六進(jìn)制數(shù)字。其中p為存儲(chǔ)十六進(jìn)制數(shù)字的數(shù)組。
void div(int p[])
void add(int a[],int b[]) 這兩個(gè)函數(shù)都是為最后把十六進(jìn)制數(shù)字轉(zhuǎn)換為十進(jìn)制數(shù)字服務(wù)的。
最后把1000個(gè)數(shù)字分別存儲(chǔ)在整型數(shù)組r[]中,輸出就是按順序輸出該數(shù)組。
標(biāo)簽:
int
double
bbp
算法
上傳時(shí)間:
2014-01-05
上傳用戶:xcy122677
-
Java 版本的 PHP serialize/unserialize 完整實(shí)現(xiàn)。目前實(shí)現(xiàn)了對各種基本類型、數(shù)組、ArrayList、HashMap、和其它可序列化對象的序列化。實(shí)現(xiàn)了 PHP 5 中的Serializable 接口的支持。實(shí)現(xiàn)了 PHP 中的 __sleep 和 __wakeup 魔術(shù)方法的支持。實(shí)現(xiàn)了對所有標(biāo)示(N、b、i、d、s、a、O、R、r、U、C)的反序列化,在對標(biāo)示 a 反序列化時(shí),可以根據(jù)下標(biāo)和值來自動(dòng)判斷是 ArrayList 還是 HashMap。并且在反序列化時(shí)可以強(qiáng)制指定反序列化的類型。該類是靜態(tài)類,無需也不能被實(shí)例化。除了包含了 serialize 和 unserialize 方法以外,還增加了一個(gè) cast 方法,用來進(jìn)行反序列化后的類型轉(zhuǎn)換,該方法主要用于將反序列化后的 ArrayList 轉(zhuǎn)化為數(shù)組或者 HashMap。
標(biāo)簽:
unserialize
ArrayList
PHP
serialize
上傳時(shí)間:
2016-01-06
上傳用戶:奇奇奔奔
-
We have a group of N items (represented by integers from 1 to N), and we know that there is some total order defined for these items. You may assume that no two elements will be equal (for all a, b: a<b or b<a). However, it is expensive to compare two items. Your task is to make a number of comparisons, and then output the sorted order. The cost of determining if a < b is given by the bth integer of element a of costs (space delimited), which is the same as the ath integer of element b. Naturally, you will be judged on the total cost of the comparisons you make before outputting the sorted order. If your order is incorrect, you will receive a 0. Otherwise, your score will be opt/cost, where opt is the best cost anyone has achieved and cost is the total cost of the comparisons you make (so your score for a test case will be between 0 and 1). Your score for the problem will simply be the sum of your scores for the individual test cases.
標(biāo)簽:
represented
integers
group
items
上傳時(shí)間:
2016-01-17
上傳用戶:jeffery
-
單純形法算法,int K,M,N,Q=100,Type,Get,Let,Et,Code[50],XB[50],IA,IAA[50],Indexg,Indexl,Indexe
float Sum,A[50][50],B[50],C[50]
標(biāo)簽:
50
Indexg
Indexe
Indexl
上傳時(shí)間:
2013-12-22
上傳用戶:頂?shù)弥?/p>
-
1. Matrix-chain product. The following are some instances
a) <3, 5, 2, 1,10>
b) <2, 7, 3, 6, 10>
c) <10, 3, 15, 12, 7, 2>
d) <7, 2, 4, 15, 20, 5>
標(biāo)簽:
Matrix-chain
following
instances
product
上傳時(shí)間:
2014-11-28
上傳用戶:731140412
-
編寫一個(gè)用SOR法解方程組Ax=b的計(jì)算機(jī)程序,其中
要求程序中不存系數(shù)A,分別對不同的階數(shù)(例如n=15,80)取w=1.7,1.8,1.9,進(jìn)行迭代,記錄近似解 達(dá)到 時(shí)所用迭代次數(shù)k,觀察松弛因子對收斂速度的影響。
標(biāo)簽:
SOR
Ax
編寫
方程
上傳時(shí)間:
2013-12-25
上傳用戶:wcl168881111111
-
具體實(shí)現(xiàn)以下4條基本編輯命令:
(1) 行插入。格式:i《行號》《回車》《文本》。《回車》
將《文本》插入活區(qū)中第《行號》行之后。
(2) 行刪除。格式:d《行號1》[《空格》《行號2》]《回車》
刪除活區(qū)中第《行號1》行(到第《行號2》行)。例如:“d10”和“和d10 14”。
(3)活區(qū)切換。格式:n《回車》
將活區(qū)寫如輸出文件。并從輸入文件中讀入下一段,作為新的活區(qū)。
(4)活區(qū)顯示。格式:p《回車》
各條命令中的行號均須在活區(qū)中各行行號范圍之內(nèi),只有插入命令的行號可以等于活區(qū)第一行行號減一,表示插入當(dāng)前屏幕中第一行之前,否則命令參數(shù)非法
標(biāo)簽:
編輯
命令
刪除
上傳時(shí)間:
2013-12-27
上傳用戶:lvzhr
-
Generate 100 samples of a zero-mean white noise sequence with variance , by using a uniform random number generator.
a Compute the autocorrelation of for .
b Compute the periodogram estimate and plot it.
c Generate 10 different realizations of , and compute the corresponding sample autocorrelation sequences , and . Compute the average autocorrelation sequence as and the corresponding periodogram for .
d Compute and plot the average periodogram using the Bartlett method.
e Comment on the results in parts (a) through (d).
標(biāo)簽:
zero-mean
Generate
sequence
variance
上傳時(shí)間:
2016-03-04
上傳用戶:朗朗乾坤
-
A* sudo sudo/*
B* adduser script adduser
C* rmuser script rmuser
E* tout tout/*
F* dumdum dumdum
G* lostfile lostfile
H* Mkfl.localsys Makefile.localsys
I* spacegripe spacegripe
J* sendmail.cf sendmail.cf
N* remote remote.c
O* distributed conrol distrib/*
P* hosts and name server makerevhosts
Q* xargs xargs/*
標(biāo)簽:
adduser
script
rmuser
sudo
上傳時(shí)間:
2016-03-29
上傳用戶:gxrui1991