Check out example codes for "how to find decimal value of a binary number in linked list". It will help you in understanding the concepts better.

Code Example 1

/* Returns decimal value of binary linked list */
int decimalValue(struct Node *head) 
{ 
    // Initialized result 
    int  res = 0; 
  
    // Traverse linked list 
    while (head != NULL) 
    { 
        // Multiply result by 2 and add 
        // head's data 
        res = (res  << 1) + head->data; 
  
        // Move next 
        head = head->next; 
    } 
    return res; 
} 
 

Learn ReactJs, React Native from akashmittal.com