Get your own website
Python
C
Java
 
Python result:
C result:
Java result:
Traversing forward:
3 -> 5 -> 13 -> 2 -> null

Traversing backward:
2 -> 13 -> 5 -> 3 -> null
Forward: 3 -> 5 -> 13 -> 2 -> NULL
Backward: 2 -> 13 -> 5 -> 3 -> NULL
Forward: 3 -> 5 -> 13 -> 2 -> null
Backward: 2 -> 13 -> 5 -> 3 -> null