mirror of
https://github.com/guilhermewerner/paa
synced 2025-06-15 13:04:18 +00:00
44 lines
711 B
C++
44 lines
711 B
C++
#pragma once
|
|
|
|
#include <algorithm>
|
|
#include <bits/stdc++.h>
|
|
#include <cstdlib>
|
|
#include <ctime>
|
|
#include <iostream>
|
|
#include <list>
|
|
#include <sstream>
|
|
#include <string.h>
|
|
#include <thread>
|
|
|
|
using namespace std;
|
|
|
|
class Graph
|
|
{
|
|
private:
|
|
int length;
|
|
list<int> *adj;
|
|
|
|
public:
|
|
Graph(int length)
|
|
{
|
|
this->length = length;
|
|
this->adj = new list<int>[length];
|
|
}
|
|
|
|
~Graph()
|
|
{
|
|
delete[] adj;
|
|
}
|
|
|
|
public:
|
|
void Print();
|
|
void Insert(int u, int v);
|
|
void InsertD(int u, int v);
|
|
void Remove(int u, int v);
|
|
void RemoveD(int u, int v);
|
|
void TransitiveReduction1();
|
|
void TransitiveReduction2();
|
|
void TransitiveReduction3();
|
|
Graph *Clone();
|
|
};
|