Check out example codes for "how to get the length of a linked list in c". It will help you in understanding the concepts better.

Code Example 1

typedef struct node{
    int value; //this is the value the node stores
    struct node *next; //this is the node the current node points to. this is how the nodes link

int len(node *head){
    node *tmp = head;
    int counter = 0;

    while(tmp != NULL){
        counter += 1;
        tmp = tmp->next;
    return counter;

Learn ReactJs, React Native from