fixed bugs

This commit is contained in:
pavanvpatil 2022-10-30 00:40:52 +05:30
parent 9f9530a065
commit 5006efe082
1 changed files with 4 additions and 3 deletions

View File

@ -26,6 +26,7 @@ gboolean kmeans(struct data_frame *df)
{ {
if (headk == NULL) if (headk == NULL)
{ {
headk = (struct kmeans1 *)malloc(sizeof(struct kmeans1));
headk->A = 50; headk->A = 50;
headk->B = 49; headk->B = 49;
headk->C = 51; headk->C = 51;
@ -79,10 +80,10 @@ gboolean kmeans(struct data_frame *df)
} }
break; break;
} }
previous=temp; previous = temp;
temp = temp->next; temp = temp->next;
} }
if(temp==NULL) if (temp == NULL)
{ {
struct kmeans1 *bring = (struct kmeans1 *)malloc(sizeof(struct kmeans1)); struct kmeans1 *bring = (struct kmeans1 *)malloc(sizeof(struct kmeans1));
bring->A = 50; bring->A = 50;
@ -93,7 +94,7 @@ gboolean kmeans(struct data_frame *df)
bring->count_C = 1000; bring->count_C = 1000;
bring->next = NULL; bring->next = NULL;
bring->idcode = to_intconvertor(df->idcode); bring->idcode = to_intconvertor(df->idcode);
previous->next=bring; previous->next = bring;
return TRUE; return TRUE;
} }
} }