Skip to content

Instantly share code, notes, and snippets.

@madsravn
Created September 10, 2013 12:14
Show Gist options
  • Save madsravn/6508545 to your computer and use it in GitHub Desktop.
Save madsravn/6508545 to your computer and use it in GitHub Desktop.
C++ interfaces
#ifndef DIJKSTRA_HPP_
#define DIJKSTRA_HPP_
#include "IQueue.hpp"
class Dijkstra {
public:
Dijkstra();
Dijkstra(IQueue queue);
private:
IQueue pq;
};
#endif
#ifndef FHEAP_HPP_
#define FHEAP_HPP_
#include "FTree.hpp"
#include "IQueue.hpp"
#include <vector>
class FHeap : public IQueue {
public:
FHeap();
virtual void MakeHeap();
private:
std::vector<FTree> forest;
};
#endif
#ifndef IQUEUE_HPP_
#define IQUEUE_HPP_
class IQueue {
public:
virtual void MakeHeap() = 0;
protected:
IQueue() {}
};
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment