ref: 4d5b562d78b2ac82526f634ee4800d25d1775065
parent: 506fdba9e439717fc4331ab4bb05541dd2aba57e
author: mkf <mkf@cloud9p.org>
date: Sun Nov 26 21:27:42 EST 2023
add libc/lllen.c, size of a linked list
--- /dev/null
+++ b/libc/lllen.c
@@ -1,0 +1,17 @@
+#include <u.h>
+
+int
+lllen(ll_t *head)
+{
+ int i;
+ ll_t *t;
+
+ t = head;
+ i = 0;
+ while(t != nil)
+ {
+ i++;
+ t = t->next;
+ }
+ return i;
+}