Question
//struct is common userdefined datatype in c/c++ and class is it's alternative
struct node* XOR (struct node *a, struct node *b)
{
return ((int) (a) ^ (int) (b)); //this logic is used to fill the nodes with address of a xor linked list
}
a.
nothing wrong. everything is fine
b.
type casting at return is missing
c.
parameters are wrong
d.
total logic is wrong
Posted under Data Structures and Algorithms
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What’s wrong with this code which returns xor of two nodes address ?
Similar Questions
Discover Related MCQs
Q. Given 10,8,6,7,9
swap the above numbers such that finally you got 6,7,8,9,10
so now reverse 10
9,7,6,8,10
now reverse 9
8,6,7,9,10
7,6,8,9,10
6,7,8,9,10
At this point 6 is ahead so no more reversing can be done so stop.
To implement above algorithm which datastructure is better and why ?
View solution
Q. Free lists are used in
View solution
Q. What are implicit and explicit implementations of freelists?
View solution
Q. What datastructures can be used in implementing a free list?
View solution
Q. What are different ways of implementing free lists and which is simple among them?
View solution
Q. What is buddy memory management of free lists ?
View solution
Q. How does implicit free lists(garbage collection) works in adding memory to free list ?
View solution
Q. What are the disadvantages in implementing buddy system algorithm for free lists ?
View solution
Q. How are free blocks linked together mostly and in what addressing order?
View solution
Q. Accessing free list very frequently for wide range of addresses can lead to
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Data Structures and Algorithms? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!