Se connecter avec
S'enregistrer | Connectez-vous

Liste chainee et tri

Dernière réponse : dans Programmation

Bonjour a tout le monde , j'orai besoin d'un aide je voudrai utiliser un tri fusion combiner avec un tri rapide je voudrai une sorte d'exemple car mn programme segfault
void my_swap(int *str, int i, int j)
{
int tmp;

tmp = str;
str = str[j];
str[j] = tmp;
}

void my_quicksort(int *l_a, int begin, int end)
{
int left;
int right;
int rot;

rot = l_a[begin];
left = begin - 1;
right = end + 1;

if (begin >= end)
{
my_putstr("pas de tri\n");
}
while (begin != '\0')
{
while (l_a > rot)
{
right--;
while (l_a[left] < rot)
{
left++;
}
}
if (left < right)
{
my_swap(l_a, left, right);
}
else
{
my_putstr("pas de tri\n");
}
}
my_quicksort(l_a, begin, right)
my_quicksort(l_a, right + 1, end);


Merci d'avance :bounce: 

Autres pages sur : liste chainee tri

Lassé par la pub ? Créez un compte
Lassé par la pub ? Créez un compte