formatting code

This commit is contained in:
Ashwek Swamy 2019-11-04 16:56:45 +05:30 committed by GitHub
parent 3ee9cbdfa2
commit 35f665db45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 15 deletions

View File

@ -27,16 +27,16 @@ void propagate(Contour *head)
Contour *temp = head;
if(temp!=NULL)
{
{
Contour *newNode = (Contour*)malloc(sizeof(Contour));
double diff = ( ((temp->end)-(temp->start)) / 3);
newNode->end = temp->end;
temp->end = ((temp->start)+diff);
newNode->start = (newNode->end)-diff;
newNode->next = temp->next;
temp->next=newNode;
propagate(temp->next->next);
@ -45,7 +45,6 @@ void propagate(Contour *head)
return;
}
void print(Contour *head)
{
@ -55,20 +54,17 @@ void print(Contour *head)
printf("\t");
printf("[%lf] -- ", temp->start);
printf("[%lf]", temp->end);
// printf("\n");
temp=temp->next;
}
printf("\n");
}
printf("\n");
}
int main(int argc, char const *argv[])
{
head=NULL;
int start_num, end_num, levels;
@ -79,14 +75,13 @@ int main(int argc, char const *argv[])
}
else
{
start_num = atoi(argv[1]);
end_num = atoi(argv[2]);
levels = atoi(argv[3]);
}
startList(start_num, end_num);
for (int i = 0; i < levels; i++)
{
printf("Level %d\t", i);
@ -96,6 +91,6 @@ int main(int argc, char const *argv[])
}
printf("Level %d\t", levels);
print(head);
return 0;
}
}