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

#include <stdint.h>
#include <skalibs/avlnode.h>

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