-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtree_init.c
More file actions
25 lines (22 loc) · 1.1 KB
/
tree_init.c
File metadata and controls
25 lines (22 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* tree_init.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mihykim <mihykim@student.42seoul.kr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/08 00:53:55 by mihykim #+# #+# */
/* Updated: 2020/04/09 00:18:47 by mihykim ### ########.fr */
/* */
/* ************************************************************************** */
#include "tree.h"
t_tree *tree_init(int (*cmp)(void *, void *))
{
t_tree *tree;
if (cmp == NULL || (tree = malloc(sizeof(t_tree))) == NULL)
return (NULL);
tree->root = NULL;
tree->cmp = cmp;
tree->size = 0;
return (tree);
}