2013-01-09から1日間の記事一覧
グラフのデータ構造をCで...面倒.. #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <stdbool.h> struct edge { int into; int weight; }; struct node { bool visitedp; int distance; struct graph *g; //Index in graph int id; struct edge **edges; }; struct edge* mk_ed</stdbool.h></stdarg.h></stdlib.h></stdio.h>…
グラフ上でダイクストラをするのをJavaで書くとすでに優先度付きキューが提供されているので多少楽はできるのですが、Cで書きたい場面もあるのです。 そこで、Cでも優先度付きキューをつかいたいです。優先度付きキューのインターフェイスを提供するなら 実…