Skip to content
Snippets Groups Projects
Commit ad8c4206 authored by Ukhanov Ilya's avatar Ukhanov Ilya
Browse files

Merged x2

parents 317079ca abc4e270
No related merge requests found
No preview for this file type
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
int main() { 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); affichertab(T1,5);
printf("\n"); printf("\n");
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
#include <stdio.h> #include <stdio.h>
#include "tris.h" #include "tris.h"
void triInsertion(int* A, int n) { void triInsertion(long* A, size_t n) {
for(int i = 1; i <= n-1; i++){ for(size_t i = 1; i <= n-1; i++){
int cle = A[i]; long cle = A[i];
int j = i - 1; size_t j = i - 1;
while(j >= 0 && A[j] > cle){ while(j+1 >= j && A[j] > cle){
A[j+1] = A[j]; A[j+1] = A[j];
j--; j = j-1;
} }
A[j+1] = cle; A[j+1] = cle;
} }
......
#ifndef TRIS_H #ifndef TRIS_H
#define TRIS_H #define TRIS_H
#include <stdint.h>
#include <stdlib.h>
void triInsertion(int* A, int n); void triInsertion(long* A, size_t n);
void triFusion(long* A, size_t size); void triFusion(long* A, size_t size);
void sousTriFusion(long* A, size_t first, size_t size); void sousTriFusion(long* A, size_t first, size_t size);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "utils.h" #include "utils.h"
void affichertab(int* T, int s){ void affichertab(long* T, int s){
for(int i = 0; i < s; i++){ for(int i = 0; i < s; i++){
printf("%d \n",T[i]); printf("%d \n",T[i]);
} }
......
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
void affichertab(int* T, int s); void affichertab(long* T, int s);
\ No newline at end of file \ No newline at end of file
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