let's go ! B)

added bfs WIP
This commit is contained in:
Tanguy MAZE
2019-03-27 18:04:14 +01:00
parent 4e87b2e587
commit 7a67b49802
6 changed files with 209 additions and 16 deletions

38
srcs/lst_ind.c Normal file
View File

@@ -0,0 +1,38 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* lst_ind.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/27 14:56:55 by tmaze #+# #+# */
/* Updated: 2019/03/27 17:45:17 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#include "lem_in.h"
t_ind *lst_indadd(t_ind **lst, int ind)
{
t_ind *new;
if ((new = (t_ind*)ft_memalloc(sizeof(t_ind))) != NULL)
{
new->index = ind;
new->next = *lst;
*lst = new;
}
return (new);
}
void lst_inddel(t_ind **lst)
{
t_ind *tmp;
while (*lst != NULL)
{
tmp = *lst;
*lst = (*lst)->next;
ft_memdel((void**)&tmp);
}
}