50+ Xor Linked List MCQs with FREE PDF

We have the best collection of Xor Linked List MCQs and answer with FREE PDF. These Xor Linked List MCQs will help you to prepare for any competitive exams like: BCA, MCA, GATE, GRE, IES, PSC, UGC NET, DOEACC Exams at all levels – you just have to practice regularly.

Xor Linked List MCQs

1. What’s wrong with this code which returns xor of two nodes address?

//struct is common userdefined datatype in c/c++ and class is it's alternative
 
struct node* XOR (struct node *a, struct node *b) 
{
    //this logic is used to fill the nodes with address of a xor linked list
    return  ((int) (a) ^ (int) (b));   
}

a) nothing wrong. everything is fine

b) type casting at return is missing

c) parameters are wrong

d) total logic is wrong

Answer: type casting at return is missing

2. Which of the following statements are true?

i) practical application of XOR linked lists are in environments with limited space requirements, such as embedded devices.

ii)xor lists are not suitable because most garbage collectors will fail to work properly with classes or structures that don’t contain literal pointers

iii)in order to calculate the address of the next node you need to remember the address of the previous node

iv)xor lists are much efficient than single, doubly linked lists and arrays

a) i, ii, iii, iv

b) i, ii, iii

c) i, ii

d) i

Answer: i, ii, iii

3. What is xor linked list?

a) uses of bitwise XOR operation to decrease storage requirements for doubly linked lists

b) uses of bitwise XOR operation to decrease storage requirements for linked lists

c) uses of bitwise operations to decrease storage requirements for doubly linked lists

d) just another form of linked list

Answer: uses of bitwise XOR operation to decrease storage requirements for doubly linked lists

4. What does a xor linked list have?

a) every node stores the XOR of addresses of previous and next nodes

b) actuall memory address of next node

c) every node stores the XOR of addresses of previous and next two nodes

d) every node stores xor 0 and the current node address

Answer: every node stores the XOR of addresses of previous and next nodes

5. What does first and last nodes of a xor linked lists contain ? (let address of first and last be A and B)

a) NULL xor A and B xor NULL

b) NULL and NULL

c) A and B

d) NULL xor A and B

Answer: NULL xor A and B xor NULL

6. In the above question would using arrays and swaping of elements in place of xor linked list would have been more efficient?

a) no not all

b) yes arrays would have been better than xor lists

c) both would be same in efficiency

d) can’t say

Answer: 7

7. Which of the following is an advantage of XOR list?

a) Almost of debugging tools cannot follow the XOR chain, making debugging difficult

b) You need to remember the address of the previously accessed node in order to calculate the next node’s address

c) In some contexts XOR of pointers is not defined

d) XOR list decreases the space requirement in doubly linked list

Answer: XOR list decreases the space requirement in doubly linked list

8. Which of the following is not the properties of XOR lists?

a) X?X = 0

b) X?0 = X

c) (X?Y)?Z = X?(Y?Z)

d) X?0 = 1

Answer: X?0 = 1

Xor Linked List MCQs Download PDF

50+ Skip List MCQs with FREE PDF

50+ Self Organizing List MCQs with FREE PDF

50+ Free List MCQs with FREE PDF

1000+ Data Structure MCQs

Abstract Data Types
Application of Stacks
Arrays Types
Types of Lists
Binary Trees
B-Trees
Trees
Heap
Trie
Hash Tables
Graph