Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
funcion quicksort
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
#include <stdio.h> #include <stdlib.h> #define N 9 int compareIntegers( const void *, const void * ); int main(void) { //int N = 9; int i; int vector[N] = {-9, 55, 45, 12, 20, 0, 78, -11, 9}; qsort( vector, N, sizeof(int), compareIntegers); for (i = 0 ; i < N ; i++) printf("%d ", vector[i]); return 0; } int compareIntegers( const void *a, const void *b ) { int *ptrA = (int *) a; int *ptrB = (int *) b; if ( *ptrA == *ptrB) return 0; return ( *ptrA > *ptrB )? 1: -1; }
gcc
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
Compilation time: 0.12 sec, absolute running time: 0.13 sec, cpu time: 0.05 sec, memory peak: 3 Mb, absolute service time: 0,26 sec
edit mode
|
history
|
discussion
-11 -9 0 9 12 20 45 55 78