Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Leader *FindVertex(Leader *&Graph,int key)
- {
- Leader *a = Graph;
- while (a && a->key != key)
- {
- a = a->nx;
- }
- if (!a)
- {
- Leader *newLD = new Leader{ key, 0, Graph, nullptr };
- Graph = newLD;
- a = Graph;
- }
- return a;
- }
- bool IsInTrailer(Trailer *tr, int key)
- {
- for (Trailer *t = tr; t; t = t->nx)
- {
- if (t->ld->key == key)
- {
- return true;
- }
- }
- return false;
- }
- bool IsCompleteGraph(Leader *Graph, int a, int b, int c)
- {
- Leader *Va = FindVertex(Graph, a);
- Leader *Vb = FindVertex(Graph, b);
- Leader *Vc = FindVertex(Graph, c);
- return IsInTrailer(Va->tr, b) && IsInTrailer(Va->tr, c)
- && IsInTrailer(Vb->tr, a) && IsInTrailer(Vb->tr, c)
- && IsInTrailer(Vc->tr, a) && IsInTrailer(Vc->tr, b);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement