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

#include <skalibs/avlnode.h>

unsigned int avlnode_extremenode (avlnode const *s, unsigned int max, unsigned int r, int h)
{
  register unsigned int oldr = r ;
  for (; r < max ; oldr = r, r = s[r].child[h]) ;
  return oldr ;
}