This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //algoritma dijkstra | |
| function Dijkstra(roads, source, dest) { | |
| var inf = Number.POSITIVE_INFINITY; | |
| var distance = {}; | |
| var done = {}; | |
| var pred = {}; | |
| for (var i in roads) { | |
| // jalan tidak diketahui | |
| distance[i] = inf; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // WARNING: Requires C99 compatible compiler | |
| #include <unistd.h> | |
| #include <stdlib.h> | |
| #include "heap.h" | |
| #define CMP(a, b) ((a) >= (b)) | |
| static const unsigned int base_size = 4; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <math.h> | |
| #include <cmath> | |
| using namespace std; | |
| //sensor kiri 0 == 0 cm | |
| float nba=0,nbb=6; //ambang dekat | |
| float nna=0,nnb=6,nnc=18; //ambang normal | |
| float nsa=6,nsb=18; //ambang jauh | |
| //sensor kanan 0 == 0 cm | |
| float pba=0,pbb=6; //ambang dekat |
NewerOlder