http://www.geeksforgeeks.org/decimal-equivalent-of-binary-linked-list/
Given a singly linked list of 0s and 1s find its decimal equivalent.
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;
}