This commit is contained in:
2023-12-10 15:48:26 +01:00
parent cdbec2b91f
commit 7a18fddeb4
44 changed files with 1977 additions and 10 deletions

View File

@@ -3,15 +3,18 @@
#include <assert.h>
struct stack_t {
/*
votre implantation
*/
int size;
int * tableau;
int index;
};
stack_t * stack_create( int max_size)
{
stack_t new;
new.size = max_size;
new.index = index;
return *new;
}
@@ -22,11 +25,22 @@ int stack_destroy(stack_t * s)
int stack_push(stack_t *s,int val)
{
if (s->index == 0){
s->tableau = malloc(s->size * sizeof(int);
}
if (s->index == s->size - 1){
return -1
}
s->tableau[value]=val;
s->value = s->value + 1;
return EXIT_SUCCESS;
}
int stack_pop(stack_t *s,int * val)
{
if (s->index == 0){
return -1;
}
s->
}