Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Sirali_mi_fonksyonu
//Title of this code //gcc 4.9.2 #include<stdio.h> #include<stdlib.h> typedef struct node node; struct node{ int key; node*next; }; void initialize_list(int a,node**l){ *l=(node*)malloc(sizeof(node)); if(*l==NULL)exit(1); (*l)->key=a; (*l)->next=NULL; } void add(int a,node**l){ if(*l==NULL){ *l=(node*)malloc(sizeof(node)); if(*l==NULL)exit(1); (*l)->key=a; (*l)->next=NULL; return; } else add(a,&((*l)->next)); } void print(node*l){ if(l==NULL)return; printf("%d\t",l->key); print(l->next); } int sirali_mi(node*list){ if(list==NULL) return 1; node*simdiki=list; node*sonraki=list->next; while(sonraki!=NULL){ if(simdiki->key<=sonraki->key)return 0; simdiki=sonraki; sonraki=sonraki->next; } return 1; } int main(void) { node*list=NULL; initialize_list(50,&list); add(40,&list); add(30,&list); add(7,&list); add(5,&list); print(list); if(sirali_mi(list)) printf("\nListemiz Buyukten Kutuge Siralidir !!!"); else printf("\nListemiz Buyukten Kutuge Sirali degildir !!!"); }
run
|
edit
|
history
|
help
0
150108_recursividadFactorial
Memoria dinamica no funciona ;C
CheckProcessorEndianness
is_there_segfault
summing long int
DDD
C141105_SwitchNotas
My first reevers C 2darryp
C_141127_MatrizProducto
Virtual table sketch