minimmum spanning tree

implementation of minimum spanning tree using binary heap in c or c++???????????please write code in c or c++ ...
I've created code for you which you can use as a template.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
class BinaryHeap
{
public:
    const char* name;

    BinaryHeap()
    {
        name = "I'm a Binary Heap";
    }
};

class MinimumSpanningTree
{
public:
    const char* name;

    MinimumSpanningTree()
    {
        name = "I'm a Minimum Spanning Tree";
    }

    void CreateWith(BinaryHeap* binHeap)
    {
        //fill in code here which creates a minimum spanning tree with a binary heap
    }
};

int main()
{
    BinaryHeap binHeap;
    MinimumSpanningTree tree;

    tree.CreateWith(&binHeap);

    return (int) tree.name;
}
Topic archived. No new replies allowed.