Dijkstra算法求最短路徑(C#版) using System
using System.Collections
using System.Text
namespace Greedy
{
class Marx
{
private int[] distance
private int row
private ArrayList ways = new ArrayList()
public Marx(int n,params int[] d)
{
this.row = n
distance = new int[row * row]
for (int i = 0 i < row * row i++)
{
this.distance[i] = d[i]
DataBurn is an Objective-C example which demonstrates some of the features of DRTracks. The sample illustrates how to create a DRFolder from an existing folder on the source disk and burn it to disc, creating a hybrid ISO9660/Joliet/HFS+ data CD. The sample also uses the DiscRecordingUI framework to present the standard burn setup and progress user interfaces.
本書提供用J B u i l d e r開發(fā)數(shù)據(jù)庫(kù)應(yīng)用程序、創(chuàng)建分布式應(yīng)用程序以及編寫J a v a B e a n
組件的高級(jí)資料。它包括下列幾個(gè)部分:
• 第一部分是“開發(fā)數(shù)據(jù)庫(kù)應(yīng)用程序”,它提供關(guān)于使用J b u i l d e r的D a t a E x p r e s s數(shù)據(jù)
庫(kù)體系結(jié)構(gòu)的信息,并解釋原始數(shù)據(jù)組件和類之間的相互關(guān)系,以及怎樣使用它
們來創(chuàng)建你的數(shù)據(jù)庫(kù)應(yīng)用程序。它還解釋怎樣使用Data Modeler(數(shù)據(jù)模型器)和
Application Generator(應(yīng)用程序生成器)創(chuàng)建數(shù)據(jù)驅(qū)動(dòng)的客戶機(jī)/服務(wù)器應(yīng)用程
序。
• 第二部分是“開發(fā)分布式應(yīng)用程序”,它提供關(guān)于使用ORB Explorer、用J B u i l d e r
創(chuàng)建多級(jí)的分布應(yīng)用程序、調(diào)試分布式應(yīng)用程序、用J a v a定義C O R B A接口以及
使用s e r v l e t等的信息。
• 第三部分是“創(chuàng)建J a v a B e a n”,它解釋怎樣開發(fā)新的J a v a B e a n組件,描述在組件
開發(fā)中涉及的任務(wù), 怎樣使用B e a n s E x p r e s s創(chuàng)建新的J a v a B e a n,以及關(guān)于屬性、
事件、B e a nIn f o類和其他方面的詳細(xì)情況。
Solving Engineering Problems Using MATLAB C++ Math Library Introduction
In the previous article, we studied how can use MATLAB C API to solve engineering problems. In this article I will show you how can use MATLAB C++ math library. The MATLAB® C++ Math Library serves two separate constituencies: MATLAB programmers seeking more speed or complete independence from interpreted MATLAB, and C++ programmers who need a fast, easy-to-use matrix math library. To each, it offers distinct advantages.
Floyd-Warshall算法描述
1)適用范圍:
a)APSP(All Pairs Shortest Paths)
b)稠密圖效果最佳
c)邊權(quán)可正可負(fù)
2)算法描述:
a)初始化:dis[u,v]=w[u,v]
b)For k:=1 to n
For i:=1 to n
For j:=1 to n
If dis[i,j]>dis[i,k]+dis[k,j] Then
Dis[I,j]:=dis[I,k]+dis[k,j]
c)算法結(jié)束:dis即為所有點(diǎn)對(duì)的最短路徑矩陣
3)算法小結(jié):此算法簡(jiǎn)單有效,由于三重循環(huán)結(jié)構(gòu)緊湊,對(duì)于稠密圖,效率要高于執(zhí)行|V|次Dijkstra算法。時(shí)間復(fù)雜度O(n^3)。
考慮下列變形:如(I,j)∈E則dis[I,j]初始為1,else初始為0,這樣的Floyd算法最后的最短路徑矩陣即成為一個(gè)判斷I,j是否有通路的矩陣。更簡(jiǎn)單的,我們可以把dis設(shè)成boolean類型,則每次可以用“dis[I,j]:=dis[I,j]or(dis[I,k]and dis[k,j])”來代替算法描述中的藍(lán)色部分,可以更直觀地得到I,j的連通情況。
μC/OS-II Goals
Probably the most important goal of μC/OS-II was to make it backward compatible with μC/OS (at least from an
application’s standpoint). A μC/OS port might need to be modified to work with μC/OS-II but at least, the application
code should require only minor changes (if any). Also, because μC/OS-II is based on the same core as μC/OS, it is just
as reliable. I added conditional compilation to allow you to further reduce the amount of RAM (i.e. data space) needed
by μC/OS-II. This is especially useful when you have resource limited products. I also added the feature described in
the previous section and cleaned up the code.
Where the book is concerned, I wanted to clarify some of the concepts described in the first edition and provide
additional explanations about how μC/OS-II works. I had numerous requests about doing a chapter on how to port
μC/OS and thus, such a chapter has been included in this book for μC/OS-II.