Skip to content
Snippets Groups Projects
Commit abc4e270 authored by malric litiere's avatar malric litiere
Browse files

avant pull

parent e1ef5fe3
Branches
No related merge requests found
No preview for this file type
......@@ -5,9 +5,9 @@
int main() {
int T1[5] ={3,2,5,1,4} ;
long T1[5] ={3,2,5,1,4} ;
int T2[8] ={3,2,8,4,1,6,7,5} ;
long T2[8] ={3,2,8,4,1,6,7,5} ;
affichertab(T1,5);
printf("\n");
......
No preview for this file type
......@@ -2,13 +2,13 @@
#include <math.h>
#include <stdlib.h>
void triInsertion(int* A, int n){
for(int i = 1; i <= n-1; i++){
int cle = A[i];
int j = i - 1;
while(j >= 0 && A[j] > cle){
void triInsertion(long* A, size_t n){
for(size_t i = 1; i <= n-1; i++){
long cle = A[i];
size_t j = i - 1;
while(j+1 >= j && A[j] > cle){
A[j+1] = A[j];
j--;
j = j-1;
}
A[j+1] = cle;
}
......
#include <stdint.h>
#include <stdlib.h>
void triInsertion(int* A, int n);
\ No newline at end of file
void triInsertion(long* A, size_t n);
\ No newline at end of file
No preview for this file type
......@@ -2,7 +2,7 @@
#include <stdlib.h>
#include "utils.h"
void affichertab(int* T, int s){
void affichertab(long* T, int s){
for(int i = 0; i < s; i++){
printf("%d \n",T[i]);
}
......
#include <stdio.h>
#include <stdlib.h>
void affichertab(int* T, int s);
\ No newline at end of file
void affichertab(long* T, int s);
\ No newline at end of file
No preview for this file type
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment