summaryrefslogtreecommitdiff
path: root/src/libdatastruct/avltreen_insert.c
blob: f2b858446959180b3b2b55f3d8ae757a70b4de09 (plain)
1
2
3
4
5
6
7
8
9
10
11
/* ISC license. */

#include <skalibs/avltreen.h>

int avltreen_insert (avltreen *t, uint32_t d)
{
  uint32_t i = avltreen_newnode(t, d) ;
  if (i >= avltreen_totalsize(t)) return 0 ;
  avltreen_insertnode(t, i) ;
  return 1 ;
}