Advertisement
Mikhail-Podbolotov

Untitled

May 15th, 2024
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. #pragma once
  2. #include <iostream>
  3. #include <fstream>
  4. #include <string>
  5. using namespace std;
  6.  
  7. struct Edge {
  8.     int x1;
  9.     int x2;
  10.     Edge* next = nullptr;
  11. };
  12. struct AdjPoint {
  13.     int value;
  14.     AdjPoint* next = nullptr;
  15. };
  16.  
  17. struct Point
  18. {
  19.     int number;
  20.     AdjPoint* First = nullptr;
  21.     AdjPoint* Last = nullptr;
  22.     Point* NextPoint = nullptr;
  23. };
  24.  
  25. class List
  26. {
  27. private:
  28.     Point* Start = nullptr;
  29.     Point* End = nullptr;
  30. public:
  31.     List();
  32.     ~List();
  33.     Point* getStart();
  34.     int GetLast();
  35.     void addPoint();
  36.     void addAdjPoint(int);
  37.     void Print(std::ofstream& file);
  38.     void Read(std::ifstream& file);
  39. };
  40.  
  41. class EdgeList {
  42. private:
  43.     Edge* Start = nullptr;
  44.     Edge* End = nullptr;
  45. public:
  46.     EdgeList();
  47.     ~EdgeList();
  48.     bool find(int x1,int x2);
  49.     void appendEdge(int x1,int x2);
  50.     void readFromList(List& A);
  51.     void print(std::ofstream& file);
  52. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement