×îСÉú³ÉÊ÷µÄKruskalËã·¨(C/C++) ¸½ÓвâÊÔÊý¾ÝºÍ½á¹û
/*
*Ëã·¨ÔÀí£º½«Í¼G Öеı߰´È¨Êý´ÓСµ½´óÖðÌõ¿¼²ì,
* °´²»¹¹³ÉȦµÄÔÔò¼ÓÈëµ½TÖÐ(ÈôÓÐÑ¡Ôñʱ, ²»Í¬µÄÑ¡
* Ôñ¿ÉÄܻᵼÖÂ×îºóÉú³ÉÊ÷µÄȨÊý²»Í¬), Ö±µ½
* q(T) = p(G)-1Ϊֹ, ¼´ T µÄ±ßÊý = G µÄ¶¥µã1 Ϊֹ.
*Ëã·¨ÖÐÎÞȦÐÔµÄÅж¨±È½ÏÂé·³£¬Ó¦¸ÃÓñê¼Ç·¨×îºÃ£¬
*¶Ô¸÷¸ö·ÖÖ§µÄ¶¥µã±êºÅ¡£
*ÎÒû×Ðϸ¿´Ê飬ÆäʵÊéÉÏдµÃºÜÇå³þ£¬ÊÇÀÏʦÌáÐÑµÄ ^_^ ¡£
*²Î¿¼Ê飺2004£¬¡¶Í¼ÂÛ¼°ÆäÓ¦Óá·£¬¿Æѧ³ö°æÉ磬Ëï»ÝȪ ±àÖø¡£
*/
#include<iostream>
#include<fstream>
#define N 100
using namespace std;
int n;//½áµãÊý
int a[N][N] = {0};
bool judgeNode(int flagNodes[N]){//ÅжÏÊÇ·ñ»¹ÓÐδ·ÃÎʽáµã
for(int i = 0; i < n; i++)
if(flagNodes[i] == 0) return 1;
return 0;
}
void judgeSub(int flagSub[N], int x, int y){//±ê¼Ç·ÖÖ§
if(flagSub[x] != 0){
if(flagSub[y] == 0) flagSub[y] = flagSub[x];
else{
int min = flagSub[x] < flagSub[y] ? flagSub[x] : flagSub[y];
int max = flagSub[x] + flagSub[y] - min;
for(int i = 0; i < n; i++)
if(flagSub[i] == max)
flagSub[i] = min;
}
}
else{
if(flagSub[y] == 0){
int max = 0;
for(int i = 0; i < n; i++){
if(flagSub[i] != 0 && flagSub[i] > max)
max = flagSub[i];
}
flagSub[x] = flagSub[y] = ++max;
}
else flagSub[x] = flagSub[y];
}
}
bool judgeCircle(int flagSub[N], int x, int y){//ÅжÏÉú³ÉÊ÷ÖÐÎÞȦ
if(flagSub[x] == 0 && flagSub[y] == 0) return 1;
if(flagSub[x] != flagSub[y]) return 1;
return 0;
}
void kruskal(){
int temp[N][N] = {0};
int flagNodes[N] = {0};
int flagSub[N] = {0};
int least = N;
int x = 0, y = 0;
cout<<"The edges of Optimal tree:"<<endl;
while(judgeNode(flagNodes)){
least = N;
for(int i = 0; i < n; i++){
for(int j = i+1; j < n; j++){
Ïà¹ØÎĵµ£º
·½°¸Ò»£º
// html & JavaScript
...
<button value="Click me"
onclick="window.navigate('app:command&arg1=1&arg2=2')" />
...
// C++: ÏìÓ¦ µÄÏûÏ¢º¯ÊýOnBeforeNavigat2
virtual void OnBeforeNavigate2( LPCTSTR lpszURL, DWORD nFlags, LPCTSTR lpszTar ......
תCºÍ»ã±à»ìºÏ±à³Ì
.dataÊdzõʼ»¯µÄÊý¾Ý¿é¡£ÕâЩÊý¾Ý°üÀ¨±àÒëʱ±»³õʼ»¯µÄglobleºÍstatic±äÁ¿£¬Ò²°üÀ¨×Ö·û´®¡£
Á¬½ÓÆ÷½«OBJs¼°LIBsÎļþµÄ.data½áºÏ³ÉÒ»¸ö´óµÄ.data¡£local±äÁ¿ÒÔ·ÅÔÚÒ»¸öÏßÐԵĶÑÕ»ÖУ¬
²»Õ¼.dataºÍ.bssµÄ¿Õ¼ä¡£ºÍ.textÒ»Ñù£¬Êý¾Ý¿éÊÇÒÔÃ÷ÎĵÄÐÎʽ´æ·ÅÔÚÎļþÖеġ£ÎÞ·¨·ÀÖ¹¶ÔÆäÎïÀíµÄÐ޸ġ£
.bssÇøÊÇ´æ· ......
¹Ø¼üµÄʱ¿Ì - MFC Or Not
ÔÚSymantec C/C++ºÍWatcom C/C++Öð½¥µØÕ¾ÎÈÁ˽Ų½Ö®ºó£¬ËÄ´ó±àÒëÆ÷¾öÕ½µÄʱ¿ÌÒ²Ö𽥱ƽüÁË¡£ÔÚ1994ÄêδµÄ¾öս֮ǰ£¬SymantecºÍWatcomͬʱÃæ¶ÔÁËÒ»¸ö·Ç³£ÑÏÀ÷µÄ¿¼Ñ飬ÄǾÍÊÇC/C++ FrameworkµÄÑ¡Ôñ¡£ËäÈ»SymantecºÍWatcom¶¼ÒÔ¸÷×ÔµÄÌØÉ«Õ¼µÃÁËÊг¡£¬²»¹ýÔÚµ±Ê±¶ÔÓÚÒ»¸öC/C++¿ª·¢¹¤¾ßÀ´Ëµ£¬×îÖØÒªµÄÒ ......
C/C++
/*
* File: main.cpp
* Author: Vicky
*
* Created on 2010Äê4ÔÂ29ÈÕ, ÉÏÎç9:46
*/
#include <iostream>
using namespace std;
int maximum(int[], int);
int main(int argc, char** argv) {
// int sg[3][4] = {
int sg[][4] = {
{68, 77, 73, 86},
{87, 96, 7 ......
¹¹½¨»ù±¾µÄLinux C ±à³Ì»·¾³ ÊÕ²Ø
±¾ÎÄ»ùÓÚdebian-40r0(ÄÚºË2.6.18)½éÉÜÒ»ÏÂÈçºÎÔÚÒ»¸ö±ê׼ϵͳÖй¹½¨Linux CµÄ»ù±¾±à³Ì¿ª·¢»·¾³¡£
Ò»¸öÍêÕûµÄ¿ª·¢»·¾³Ö÷Òª°üÀ¨Ëĸö²¿·Ö£º±ê×¼C¿â¡¢Í·Îļþ¡¢¹¤¾ßÁ´¡¢±à¼Æ÷¡¢°ïÖúÎĵµ£¬ÏÂÃæÒÀ´Î½éÉÜ¡£
±ê×¼C¿âglibc
glibcÊÇgnu·¢²¼µÄlibc¿â£¬¼´cÔËÐп⡣glibcÊÇlinuxϵͳÖÐÄÚºËÖ ......