insert new_node between temp and next .
temp . next = new_node NEW_LINE new_node . prev = temp NEW_LINE new_node . next = next NEW_LINE next . prev = new_node NEW_LINE def display ( ) : NEW_LINE global start NEW_LINE temp = start NEW_LINE print ( " Traversal ▁ in ▁ forward ▁ direction : " ) NEW_LINE while ( temp . next != start ) : NEW_LINE INDENT print ( temp . data , end = " ▁ " ) NEW_LINE temp = temp . next NEW_LINE DEDENT print ( temp . data ) NEW_LINE print ( " Traversal ▁ in ▁ reverse ▁ direction : " ) NEW_LINE last = start . prev NEW_LINE temp = last NEW_LINE while ( temp . prev != last ) : NEW_LINE INDENT print ( temp . data , end = " ▁ " ) NEW_LINE temp = temp . prev NEW_LINE DEDENT print ( temp . data ) NEW_LINE