parent
882fb79be4
commit
bdb6ac8daa
@ -0,0 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* @file decalage.c
|
||||||
|
* @brief Fonctions de décalage d'un tableau
|
||||||
|
*
|
||||||
|
* Contient les fonctions de décalage de tableau vers la droite (pour l'insertion)
|
||||||
|
* et vers la gauche (pour la suppression).
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
|
void decalageADroite(int tab[], int index, int tlog)
|
||||||
|
{
|
||||||
|
for (int i = tlog; i > index; i--)
|
||||||
|
{
|
||||||
|
tab[i] = tab[i-1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void decalageAGauche(int tab[], int index, int tlog)
|
||||||
|
{
|
||||||
|
for (int i = index; i < tlog; i++)
|
||||||
|
{
|
||||||
|
tab[i] = tab[i+1];
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue