Archive for the ‘C++’ Category
Eclipse CDT (C/C++ Development Tooling)
The Eclipse CDT is an advanced C and C++ IDE based on the popular Eclipse platform. It features managed builds, various source knowledge tools, such as type hierarchy, call graph, include browser, macro definition browser, code editor with syntax highlighting, source code refactoring, code generation, visual debugging tools, including memory, registers, and disassembly viewers.
Bloodshed Dev-C++
Bloodshed Dev-C++ or DevCPP in short, is a full-featured IDE for C and C++ programming languages. It uses Mingw port of GCC (GNU Compiler Collection) as its compiler. Its features includes support for GCC-based compilers, integrated debugging using gdb, customizable syntax highlighting editor, automatic code completion, Profiling support, and much more.
Code::Blocks
Code::Blocks or Codeblocks is a free C++ IDE which can be used even in the most demanding situations. It is designed from the scratch, to be very extensible and fully configurable.
It features customizable and extensible syntax highlighting, code folding, tabbed interface, code completion, class Browser, multi user support and much more.
Netbeans IDE
You’ll be probably surprised to see Netbeans listed here, as its a popular Java IDE. But it can be used for C and C++ development as well. You can develop professional quality native applications in C, C++ using Netbeans IDE.
Its features include C and C++ unit testing, integrated profiler, packaging support, gdb integration, syntax highlighting and code assistance.
Microsoft Visual Studio Express
Microsoft® Visual Studio® 2010 Express is probably the best C++ IDE. Its free but you have to register your copy within 30 days of installation.
Download Microsoft® Visual Studio® 2010 Express Edition
The following program (C++ Â programming language)Â is implemented the Prim’s algorithm.
//========>  Prims Algorithm         <===========\\
#include <iostream.h>
#include <conio.h>
#define ROW 7
#define COL 7
#define infi 10000 Â //infi for infinity
class prims
{
int graph[ROW][COL],nodes;
public:
prims();
void createGraph();
void primsAlgo();
};
prims :: prims(){
for(int i=0;i<ROW;i++)
for(int j=0;j<COL;j++)
graph[i][j]=0;
}
void prims :: createGraph(){
int i,j;
cout<<"Enter Total Nodes: ";
cin>>nodes;
cout<<"\n\nEnter Adjacency Matrix : \n";
for(i=0;i<nodes;i++)
for(j=0;j<nodes;j++)
cin>>graph[i][j];
for(i=0;i<nodes;i++){
for(j=0;j<nodes;j++){
if(graph[i][j]==-1)
graph[i][j]=infi;
}
}
}
void prims :: primsAlgo(){
int selected[ROW],i,j,ne; //ne for no. of edges
int false=0,true=1,min,x,y;
for(i=0;i<nodes;i++)
selected[i]=false;
selected[0]=true;
ne=0;
while(ne < nodes-1){
min=infi;
for(i=0;i<nodes;i++)
{
if(selected[i]==true){
for(j=0;j<nodes;j++){
if(selected[j]==false){
if(min > graph[i][j])
{
min=graph[i][j];
x=i;
y=j;
}
}
}
}
}
selected[y]=true;
cout<<"\n"<<x+1<<" ===> "<<y+1;
ne=ne+1;
}
}
void main(){
prims MST;
clrscr();
cout<<"\n           Prim Algorithm\n";
MST.createGraph();
MST.primsAlgo();
getch();
}
Program Output:
