Home / MCQ Bank / Computer
Computer Linked Lists In Data Structures

Consider the following pseudocode of insertion in XOR list and write the approximate code snippet of it. void xor-linked-list insert(struct node **head_ref, int value) { node *new_node = new (struct node); new_node->value = value; new_node->nodepointerxored = xor (*head_ref, NULL); if (*head_pointer == NULL) { printf("invalid"); } else { let b,c,d are nodes and a is to be inserted at beginning, a address field must contain NULL xor b and b address filed must be a xor c. } *head_pointer = new_node; }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option A • node* next = XOR ((*head_ref)->npx, NULL); (*head_ref)->npx = XOR (new_node, next)

Related Computer Questions

Bellmann Ford Algorithm can be applied for ______ What is the significance of the HBase Bloom Filter Compound feature? ______ is used for the analysis of air pollution data. Which function is used to reposition the file pointer? Assume +, -, *, / are usual arithmetic operator, + has highest precedence and right associative and -, *, / have equal precedence and left associative. What is the output of the expression 23 * 3 - 6 + 11 - 2 * 8 / 4?