Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 03-31-2004, 07:02 PM   #1
Beta Member
Join Date: Mar 2004
Posts: 1
Question C++ Prim's Algorithm

I got to my minHeap to work and here is my minHeap.h file, i just need to implement a Minimal Spanning Tree using Prim's Algorithm that uses my minHeap files. My minHeap works fine, its just hard to know where to start with the Prim's Algorithm and how to use my current classes with the new MST Prim classes. If anyone can help then horray for you, and here's a cookie! YAY!!!


template<class Heap>
class BinaryHeap;

template<class Heap>
class BinaryHeap
//public functions that the user are allowed to call from the driver
explicit BinaryHeap(int capacity);
void insert(Heap x);
void removeMin();
void trans();
//private functions that the user cannot call from the driver
int isLeaf(int num);
int rightChild(int x);
int leftChild(int x);
int parent(int x);
void order();
//variables needed to implement and create a minHeap
Heap *array;
int max;
int current;
shoedatUL is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 09:56 PM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0