technojam/Ultimate_Algorithms_Repository

XOR Linked List; traversal

オープン

#314 opened on 2020/10/16

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)C++ (165 件のフォーク)auto 404
hacktoberfest

Repository metrics

Stars
 (87 個のスター)
PR merge metrics
 (PR metrics pending)

説明

XOR Linked List

  • In a doubly linked list, you store two pointers per node: prev and next. In an XOR linked list, you store one pointer per node, which is the XOR of prev and next, or if one of them is absent, just the other, which is the same as XORing with 0.
  • The reason why you can still traverse an XOR linked list in both directions relies on the properties of XOR and the redundancy of information inherent in a double linked list.

コントリビューターガイド