printing the node
if ( temp . next ) { document . write ( temp . next . data + " " ) temp = temp . next } if ( temp . prev ) { document . write ( temp . prev . data + " " ) temp = temp . prev } if ( temp . bottom ) { document . write ( temp . bottom . data + " " ) temp = temp . bottom } if ( temp . top ) { document . write ( temp . top . data + " " ) temp = temp . top } } } }