Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Sirali_mi_fonksyonu
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//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 !!!"); }
gcc
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
Compilation time: 0.12 sec, absolute running time: 0.14 sec, cpu time: 0 sec, memory peak: 4 Mb, absolute service time: 0.27 sec
edit mode
|
history
|
discussion
50 40 30 7 5 Listemiz Buyukten Kutuge Siralidir !!!