First Upload

This commit is contained in:
2022-02-25 15:33:16 +02:00
commit 0c74d10f0d
295 changed files with 74784 additions and 0 deletions

41
29 - Graphs/ex2.c Normal file
View File

@@ -0,0 +1,41 @@
#include "General.h"
//---------------------------------------------------------------------------------------
// DoesExistPath
// -------------
//
// General : Check if have path from point a to point b in graph with number of arc
//
// Parameters : Graph * a - the first item.
// Graph * b - the second item.
// unsigned int number_road - the number of arc.
//
// Return Value : Void
//
//---------------------------------------------------------------------------------------
// Programer : Cohen Idan
// Student No. : 211675038
// Date : 04.01.2020
//---------------------------------------------------------------------------------------
unsigned int DoesExistPath(Graph * start_point, Graph * end_point, unsigned int number_road)
{
LLL * temp;
if (!number_road)
{
return (start_point == end_point);
}
else
{
temp = start_point->list;
while (temp && !DoesExistPath(((Arc *)temp->value.pointer)->point, end_point, number_road - ONE))
{
temp = temp->next;
}
return (!temp);
}
}
void main(void)
{
}