function to display a doubly circular list in forward and backward direction
static void display ( Node head ) { if ( head == null ) return ; Node temp = head ; Console . Write ( " Forward ▁ direction : ▁ " ) ; while ( temp . next != head ) { Console . Write ( temp . data + " ▁ " ) ; temp = temp . next ; } Console . Write ( temp . data + " ▁ " ) ; Node last = head . prev ; temp = last ; Console . Write ( " STRNEWLINE Backward ▁ direction : ▁ " ) ; while ( temp . prev != last ) { Console . Write ( temp . data + " ▁ " ) ; temp = temp . prev ; } Console . Write ( temp . data + " ▁ " ) ; }