Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /wiki/includes/MagicWord.php on line 739

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /wiki/includes/MagicWord.php on line 722

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /wiki/includes/MagicWord.php on line 722

Warning: Parameter 3 to renderAdsense() expected to be a reference, value given in /wiki/includes/parser/Parser.php on line 3470

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /wiki/includes/MagicWord.php on line 722

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /wiki/includes/MagicWord.php on line 722

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /wiki/includes/MagicWord.php on line 739
Algorytm Prima-Dijkstry – RNO-Wiki

Algorytm Prima-Dijkstry

Z RNO-Wiki
(Nowa strona: Algorytm Prima-Dijkstry służy do znajdowania minimalnego drzewa spinającego pewnego grafu z wagami na krawędziach. W problemie chodzi o wybranie takich krawędzi, aby powstały pod...)
 
m
Linia 4: Linia 4:
  
 
Poniżej znajduje się implementacja algorytmu Prima-Dijkstry w języku C++. Nie bez powody pojawia się tu nazwisko Dijkstry. Zobacz [[Algorytm Dijkstry]], a stwierdzisz, że to prawie to samo. Ciekawe, co Prim tutaj dodał :-)
 
Poniżej znajduje się implementacja algorytmu Prima-Dijkstry w języku C++. Nie bez powody pojawia się tu nazwisko Dijkstry. Zobacz [[Algorytm Dijkstry]], a stwierdzisz, że to prawie to samo. Ciekawe, co Prim tutaj dodał :-)
 +
 +
<table width="100%">
 +
<tr>
 +
<td valign="top">
  
 
<source lang="cpp">
 
<source lang="cpp">
Linia 118: Linia 122:
 
printf("Drzewo złożone jest z następujących krawędzi:\n");
 
printf("Drzewo złożone jest z następujących krawędzi:\n");
 
for (int i=1; i<n; i++) // specjalnie pomijam wierzhołek nr 0
 
for (int i=1; i<n; i++) // specjalnie pomijam wierzhołek nr 0
printf("%d -- %d\n", i+1, pi[i]+1); // zwiekszam numery, bo zakładam, że na wejściu wierzchołki numerowane są od 1
+
// zwiekszam numery, bo zakładam, że na wejściu wierzchołki numerowane są od 1
 +
printf("%d -- %d\n", i+1, pi[i]+1);  
 
return 0;
 
return 0;
 
}
 
}
 
</source>
 
</source>
 +
</td>
 +
<td width="140" align="center">
 +
<adsense
 +
adclient="pub-2033664350513674"
 +
adslot="5958906648"
 +
adwidth="120"
 +
adheight="600"
 +
/>
 +
</td>
 +
</tr>
 +
</table>

Wersja z 12:29, 27 lut 2008

Osobiste