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

#include <skalibs/avltreen.h>

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