Skip to content

Commit 64ec157

Browse files
committed
pb6
1 parent d5f12ae commit 64ec157

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pb6/Problem.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
> This problem was asked by Google.
2+
3+
An XOR linked list is a more memory efficient doubly linked list. Instead of each node holding `next` and `prev` fields, it holds a field named both, which is an XOR of the next node and the previous node. Implement an XOR linked list; it has an `add(element)` which adds the element to the end, and a `get(index)` which returns the node at index.
4+
If using a language that has no pointers (such as Python), you can assume you have access to get_pointer and dereference_pointer functions that converts between nodes and memory addresses.

pb6/answer.js

Whitespace-only changes.

0 commit comments

Comments
 (0)