Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Node
- {
- public:
- Node(int x, Node* node);
- private:
- int mX;
- Node* mNode;
- };
- #include <list>
- using namespace std;
- struct Edge;
- struct Node
- {
- public:
- Node() : m_id(-1) {}
- Node(int id) : m_id(id) {}
- int id() { return m_id; }
- list<Edge*>& get_Edges() { return m_Edges; }
- private:
- int m_id;
- list<Edge*> m_Edges;
- };
- struct Edge
- {
- public:
- Edge() : m_id(-1), m_weight(0) {}
- Edge(const int id, const int weight) : m_id(id), m_weight(weight) {}
- int id() const { return m_id; }
- int get_weight() const { return m_weight; }
- void set_weight(int weight) { m_weight = weight; }
- Node* get_first_node() { return m_first_node; }
- Node* get_second_node() { return m_second_node; }
- void set_first_node(Node* node) { m_first_node = node; }
- void set_second_node(Node* node) { m_second_node = node; }
- private:
- int m_id;
- int m_weight;
- Node* m_first_node;
- Node* m_second_node;
- };
Add Comment
Please, Sign In to add comment