C code for XOR linked list

前端 未结 3 817
野趣味
野趣味 2020-12-23 18:12

I have been trying to implement XOR linked list and its operations but I have not been able to do it properly.

Is it possible to implement it in C since XOR link lis

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-23 18:49

    Is it possible to implement it in C since XOR link list involves operations on addresses??

    Yes it is. Addresses are pointers, pointers are numbers* and numbers allow XOR (i.e. a ^ b).

    Look up what is done, and you should be able to do the implementation.

    *At least, you can think of them as numbers - explicit casts might be required though.

提交回复
热议问题