findIndex() function added
This commit is contained in:
parent
1c913d4b82
commit
7382f0a43d
15
generator.c
15
generator.c
@ -191,6 +191,15 @@ void cleanup()
|
|||||||
free(graph.array);
|
free(graph.array);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int findIndex(int array[], int value, int size)
|
||||||
|
{
|
||||||
|
int index = 0;
|
||||||
|
while (index < size && array[index] != value)
|
||||||
|
index++;
|
||||||
|
|
||||||
|
return (index == size ? -1 : index);
|
||||||
|
}
|
||||||
|
|
||||||
void genSolution(int permutation[])
|
void genSolution(int permutation[])
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
@ -209,6 +218,12 @@ void genSolution(int permutation[])
|
|||||||
permutation[i] = tmp;
|
permutation[i] = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int u = 0; u < graph.V; u++) {
|
||||||
|
struct AdjListNode *pCrawl = graph.array[u].head;
|
||||||
|
while (pCrawl) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user