Remove Duplicate Files

This commit is contained in:
NyxiumYuuki 2019-12-07 18:35:27 +01:00
parent 74f6b061ba
commit fce98b430b
No known key found for this signature in database
GPG key ID: 03E8F3CF3183323A
9 changed files with 0 additions and 193 deletions

View file

@ -1,19 +0,0 @@
CC = gcc
CCOPTS = -Wall
all: main
arbre_naire.o: arbre_naire.c arbre_naire.h
${CC} ${CCOPTS} -c arbre_naire.c
arbre_binaire.o: arbre_binaire.c arbre_binaire.h
${CC} ${CCOPTS} -c arbre_binaire.c
main.o: main.c
${CC} ${CCOPTS} -c main.c
main: main.o arbre_naire.o arbre_binaire.o
${CC} ${CCOPTS} -o main main.o arbre_naire.o arbre_binaire.o
clean:
rm *.o ; rm main

View file

@ -1,69 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "arbre_binaire.h"
arbre creer_arbre_vide (void)
{
return NULL ;
}
arbre creer_arbre_huffman(Elt e, int p, arbre fg, arbre fd)
{
noeud * tmp = malloc(sizeof(noeud));
tmp->elt=e;
tmp->poids=p;
tmp->fils_gauche=fg;
tmp->fils_droit=fd;
return tmp;
}
arbre fils_gauche(arbre a)
{
assert(!est_arbre_vide(a));
return a->fils_gauche;
}
arbre fils_droit(arbre b)
{
assert(!est_arbre_vide(b));
return b->fils_droit;
}
Elt racine(arbre a)
{
assert(!est_arbre_vide(a));
return a->elt;
}
bool est_arbre_vide(arbre a)
{
return (a == NULL) ;
}
arbre creer_feuille(Elt e)
{
return creer_arbre(e, creer_arbre_vide(), creer_arbre_vide()) ;
}
bool est_feuille(arbre a)
{
if (est_arbre_vide(a))
return 0 ;
return (est_arbre_vide(a->fils_gauche) && est_arbre_vide(a->fils_droit)) ;
}
void free_noeud(arbre a)
{
assert(!est_arbre_vide(a));
free(a);
}
void free_arbre(arbre a)
{
if(!est_arbre_vide(a)){
free_arbre(fils_gauche(a));
free_arbre(fils_droit(a));
free(a);
}
}

View file

@ -1,25 +0,0 @@
#ifndef __ARBRE_BINAIRE__
#define __ARBRE_BINAIRE__
typedef char Elt;
typedef int bool;
struct znoeud {
Elt elt ;
int poids;
struct znoeud *fils_gauche;
struct znoeud *fils_droit;
};
typedef struct znoeud noeud ;
typedef struct znoeud * arbre;
arbre creer_arbre_vide(void);
arbre creer_arbre_huffman(Elt e, int p, arbre fg, arbre fd);
arbre fils_gauche(arbre a);
arbre fils_droit(arbre a);
Elt racine(arbre a);
bool est_arbre_vide(arbre a);
arbre creer_feuille(Elt e) ;
bool est_feuille(arbre a) ;
#endif

View file

@ -1,15 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
struct zoccurence{
int nb;
char lettre;
};
typedef struct zoccurence occ;
typedef struct zoccurence * freq;

View file

@ -1,24 +0,0 @@
#include <stdio.h>
#include "arbre_binaire.h"
struct zoccurence{
int nb;
char lettre;
};
typedef struct zoccurence occ;
typedef struct zoccurence * freq;
int main ()
{
}
/*
L est considéré comme ordonné
*/
arbre huffman(arbre H, freq L[])
{
int i;
printf(L[]->nb);
printf(L[]->lettre);
}

View file

@ -1,40 +0,0 @@
#include <stdio.h>
#include <assert.h>
#define BIN_MAX 8
void binaire(unsigned int n, char s[]);
int main(int argc, char **argv){
FILE *file;
char buffer;
int cursor,c;
file=fopen("text.txt","rb");
// EOF : End Of File
while((c=fgetc(file))!=EOF){
char sb[BIN_MAX+1];
binaire(32,sb);
printf("%s\n",sb);
}
fclose(file);
return 0;
}
void binaire(unsigned int n, char s[]){
/*
Décomposition binaire d'un entier (<BIN_MAX) et place celle-ci dans une chaîne de caractères passée en argument (s)
*/
assert(n>=BIN_MAX);
s[BIN_MAX]= '\0';
int i,r;
i=0;
while(n!=0){
r = n%2;
n = n/2;
if(0<=(BIN_MAX-i-1) && (BIN_MAX-i-1)<=BIN_MAX){
if(r==0) s[BIN_MAX-i-1]= '0';
else s[BIN_MAX-i-1]= '1';
i++;
}
}
}

View file

@ -1 +0,0 @@
ABCDE