summaryrefslogtreecommitdiff
path: root/src/libdatastruct/avlnode_extremenode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libdatastruct/avlnode_extremenode.c')
-rw-r--r--src/libdatastruct/avlnode_extremenode.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libdatastruct/avlnode_extremenode.c b/src/libdatastruct/avlnode_extremenode.c
new file mode 100644
index 0000000..57a8e59
--- /dev/null
+++ b/src/libdatastruct/avlnode_extremenode.c
@@ -0,0 +1,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 ;
+}