1.0.3 2026-04-27 10:42 2026-05-04 10:42 submit-* (limit: 3 per week) archi-* (limit: 2 per hour) epita-prepa-computer-science-prog-104-p-06-2030-firstname.lastname
├── RecapThoseAnimals
│ ├── Fundamentals
│ │ ├── double_linked_list
│ │ │ ├── Makefile
│ │ │ ├── dlist.c
│ │ │ ├── dlist.h
│ │ │ └── main.c
│ │ └── process
│ │ ├── Makefile
│ │ ├── fork.c
│ │ ├── fork.h
│ │ └── main.c
│ └── Proficiencies
│ └── double_linked_list
│ ├── Makefile
│ ├── dlist_merge_sort.c
│ ├── dlist_merge_sort.h
│ └── main.c
├── .gitignore
└── README
firstname.lastname with your login. .gitignore file is mandatory. Tests folder. .gitignore file:*.a
*.lib
*.o
*.obj
*.out
.idea/
*~
*.DotSettings.user
double_linked_list/dlist.c node containing:data,next to the next node,prev to the previous node.dlist containing:size_t size, representing the number of nodes in the listhead to the first node,tail to the last node.struct dlist *dlist_init(void);
void dlist_clear(struct dlist *list);
size_t dlist_length(struct dlist *l);
void dlist_push_front(struct dlist *l, int data);
void dlist_push_back(struct dlist *l, int data);
void dlist_remove(struct dlist *list, int data);
struct dlist *dlist_from_str(char *str);
struct node *dlist_find(struct dlist *list, int data);
void dlist_concat(struct dlist *l1, struct dlist *l2);
void dlist_insert(struct dlist *l, int data, int i);
dlist_init that allocates an empty list, initialises size to 0, head and tail to NULL. It should return a pointer to the newly created list. If an error occurs during allocation, return NULL.dlist_clear that frees all nodes in the list, as well as the list structure itself. The list should not be usable after calling this function. If the given list is NULL, don't do anything.struct dlist *dlist_init();
void dlist_clear(struct dlist *list);
struct dlist *l = dlist_init();
printf("length = %zu\n", l->size); // 0
printf("head = %p\n", (void *)l->head); // (nil) or NULL
printf("tail = %p\n", (void *)l->tail); // (nil) or NULL
dlist_clear(l);
// l is now invalid
dlist_length that computes the number of nodes in the list.head.size field.NULL, the function should return 0.size field is forbidden. Iterate over nodes instead.size_t dlist_length(struct dlist *l);
struct dlist *l = dlist_init();
size_t len = dlist_length(l);
printf("Length: %zu\n", len); // 0
dlist_clear(l);
dlist_push_front that inserts a new node with the given data at the beginning of the list.next pointer of the newly created node and the prev pointer of the old head.void dlist_push_front(struct dlist *l, int data);
struct dlist *l = dlist_init(); // l: NULL
dlist_push_front(l, 10); // l: 10 -> NULL
dlist_push_front(l, 20); // l: 20 -> 10 -> NULL
dlist_clear(l);
dlist_push_back that appends a new node with the given data to the end of the list.tail pointer to append the new node.next pointer of the old tail and the prev pointer of the new node. If any error occurs, the list must remain unchanged.void dlist_push_back(struct dlist *l, int data);
struct dlist *l = dlist_init();
dlist_push_back(l, 10); // l: 10 -> NULL
dlist_push_back(l, 20); // l: 10 -> 20 -> NULL
dlist_clear(l);
dlist_remove that removes the first node whose data matches the given value.NULL or the given value is not found, do nothing.next and prev pointers of neighboring nodes, as well as the head and tail pointers if needed.void dlist_remove(struct dlist *list, int data);
struct dlist *l = dlist_init();
dlist_push_back(l, 1);
dlist_push_back(l, 2);
dlist_push_back(l, 3);
dlist_push_back(l, 2);
// l: 1 -> 2 -> 3 -> 2 -> NULL
dlist_remove(l, 2); // l: 1 -> 3 -> 2 -> NULL
dlist_remove(l, 2); // l: 1 -> 3 -> NULL
dlist_remove(l, 2); // l: 1 -> 3 -> NULL
dlist_clear(l);
+) or minus (-) sign, followed by a number. This pattern then repeats: a sign, followed by another number, and so on.struct dlist *dlist_from_str(char *str);
dlist_from_str("+2+10+42+2+223-2"); // NULL<->10<->42<->2<->223<->NULL
dlist_from_str("-2+10+42+2+223-2"); // NULL<->10<->42<->223<->NULL
dlist_from_str(""); // Return an empty list (size = 0, head = NULL, tail = NULL)
dlist_from_str("-2-10-42-2-223"); // Return an empty list too
dlist_find will return the first node whose data field is equal to the int passed as argument.dlist_find that returns a pointer to the first node whose data matches the given integer.NULL or no matching node is found, the function should return NULL.struct node *dlist_find(struct dlist *list, int data);
struct dlist *l = dlist_init();
dlist_push_back(l, 1);
dlist_push_back(l, 2);
dlist_push_back(l, 3);
dlist_push_back(l, 2);
// l: 1 -> 2 -> 3 -> 2 -> NULL
struct node *n;
n = dlist_find(l, 1); // n->data == 1
n = dlist_find(l, 3); // n->data == 3
n = dlist_find(l, 223); // n == NULL
dlist_clear(l);
dlist_concat that takes two lists and will concatenate them in place into the first list.size, head and tail fields accordingly. Don't forget to update the prev and next pointers between the two lists.NULL, there is nothing to be done.void dlist_concat(struct dlist *l1, struct dlist *l2);
struct dlist *l1 = dlist_init();
for (int i = 0 ; i < 5 ; i++)
dlist_push_back(l1, i);
struct dlist *l2 = dlist_init();
for (int i = 0 ; i < 5 ; i++)
dlist_push_front(l2, i);
// l1: 0 <-> 1 <-> 2 <-> 3 <-> 4 <-> NULL
// l2: 4 <-> 3 <-> 2 <-> 1 <-> 0 <-> NULL
dlist_concat(l1, l2); // l1: 0 <-> 1 <-> 2 <-> 3 <-> 4 <-> 4 <-> 3 <-> 2 <-> 1 <-> 0 <-> NULL
// l1->size = 10
dlist_clear(l1); // If you freed correctly, no memory leaks should be displayed on your terminal
dlist_insert that takes a list, a value to insert and an index as parameters.head and tail pointers if necessary. Make sure to correctly update the prev and next pointers.NULL or the index is not correct, the function should not do anything.void dlist_insert(struct dlist *l, int data, int i);
struct dlist *l = dlist_init();
for (int i = 0 ; i < 5 ; i++)
dlist_push_back(l, i);
// l: 0 <-> 1 <-> 2 <-> 3 <-> 4 <-> NULL
dlist_insert(l, -4, 0); // l: -4 <-> 0 <-> 1 <-> 2 <-> 3 <-> 4 <-> NULL
dlist_insert(l, 5, 6); // l: -4 <-> 0 <-> 1 <-> 2 <-> 3 <-> 4 <-> 5 <-> NULL
dlist_insert(l, 5, 12); // l: -4 <-> 0 <-> 1 <-> 2 <-> 3 <-> 4 <-> 5 <-> NULL
dlist_clear(l);
process/fork.c fork(2)), you will be printing the prime outcome:"Child speaking: my number [n] is [a prime number]/[not a prime number]\n" ."Parent speaking: stop wasting my time of course [n] is [a prime number]/[not a prime number]\n" ."We both say hi!\n"1 if the number is prime, 0 otherwise.-1.int is_prime(size_t n);
./is_prime 73
Child speaking: my number 73 is a prime number
We both say hi!
Parent speaking: stop wasting my time of course 73 is a prime number
We both say hi!
./is_prime 42
Child speaking: my number 42 is not a prime number
We both say hi!
Parent speaking: stop wasting my time of course 42 is not a prime number
We both say hi!
"Adding guests..." should be printed, followed by a new line."Guest [name_of_guest] added." should be printed, followed by a new line."My child salutes all of you:", followed by a new line."All guests added successfully.", followed by a new line.-1. Otherwise, it should return 0.fflush(stdout) after your printf calls in both processes.int salute(int num_guests, char *guests[]);
./salute "Mister Mxyzptlk" Bubun Honney
Adding guests...
Guest [Mister Mxyzptlk] added.
Guest [Bubun] added.
Guest [Honney] added.
All guests added successfully.
My child salutes all of you:
Mister Mxyzptlk
Bubun
Honney
./salute
Adding guests...
All guests added successfully.
My child salutes all of you:
double_linked_list/dlist_merge_sort/dlist_merge_sort.c main.c file is highly recommended, feel free to use the functions you implemented in the fundamentals part to test your code.dlist_merge_sort that sorts the elements of the given list in increasing order based on their data values, using the merge sort algorithm.NULL, the function should not do anything.void dlist_merge_sort(struct dlist *l);
struct dlist *l = dlist_init();
dlist_push_back(l, 0);
dlist_push_back(l, 2);
dlist_push_back(l, 4);
dlist_push_back(l, 3);
dlist_push_back(l, 1);
// l: 0 <-> 2 <-> 4 <-> 3 <-> 1 <-> NULL
dlist_merge_sort(l); // l: 0 <-> 1 <-> 2 <-> 3 <-> 4 <-> NULL
dlist_clear(l);
dlist_print in the main.c file will not be graded, however it can be useful to test your code.1.0.1 ] 2026-04-27 15:00:00 dlist_remove > instructions: add a reminder to free node 1.0.2 ] 2026-04-27 14:00:00 dlist_init > Example: clarify the size 1.0.3 ] 2026-04-27 13:00:00 dlist_merge_sort > Example: add explanations about dlist_print 1.0.3 ] 2026-04-27 12:00:00 process > instructions: add more instructions about the return value of the function