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

#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 ;
}