Consider a C function given below:

void gateCS2021(struct ListNode* head){

int result = 0;
while(head) {
result = 2*result + head->val;
head = head->next;
}
printf("%d", result)

}

Input Linked list:  1 → 0 → 1 → 1 → 0 → 0 →1 →1 →0 → 1.

What is the value printed by gateCS2021()?

Enter numerical value using the virtual keypad. Round off where necessary.

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation