data_structures
src
data_structures
union_find
union_find_delete.c
Go to the documentation of this file.
1
/* ************************************************************************** */
3
/* */
4
/* ::: :::::::: */
5
/* union_find_delete.c :+: :+: :+: */
6
/* +:+ +:+ +:+ */
7
/* By: unite <marvin@42.fr> +#+ +:+ +#+ */
8
/* +#+#+#+#+#+ +#+ */
9
/* Created: 2020/07/21 22:07:53 by unite #+# #+# */
10
/* Updated: 2020/07/21 22:09:06 by unite ### ########.fr */
11
/* */
12
/* ************************************************************************** */
13
14
#include "
union_find.h
"
15
16
void
union_find_delete
(
t_union_find
*uf)
17
{
18
if
(!uf)
19
return ;
20
free(uf->
parent
);
21
free(uf->
nchild
);
22
free(uf);
23
}
s_union_find::parent
size_t * parent
An array with each element's parent.
Definition:
union_find.h:38
union_find.h
s_union_find
Weighted quick-union by rank with path compression by halving.
Definition:
union_find.h:36
union_find_delete
void union_find_delete(t_union_find *uf)
Deletes the union-find and frees all memory taken by its contents, or does nothing if the argument is...
Definition:
union_find_delete.c:16
s_union_find::nchild
size_t * nchild
An array with the number of each element's children.
Definition:
union_find.h:39
Generated by
1.8.16