Program Algoritma Prim
#include <cstdlib> #include <iostream> using namespace std; class prims { private: int n; //no of nodes =>tidak ada node int graph_edge[250][4]; //edges in the graph =>tepi dalam grafik int g; //no of edges in the graph => tidak ada dari tepi dalam grafik int tree_edge[250][4]; //edges in the tree => tepi di pohon int t; //no of edges in the tree => tidak ada tepi di pohon int s; //source node =>node sumber //Partition the graph in to two sets => Partisi grafik ke dua set int T1[50],t1; // Set 1 int T2[50],t2; // Set 2 public: void input(); int findset(int); void algorithm(); void output(); }; void prims::input() { cout<<"*************************************************\n" <<" program implements the prims algorithm \n" <<"*************************************************\n"; cout<<"Enter the no. of nodes in the undirected weighted graph/"<<endl; cout<<"Masukkan no tersebu...