reduce delete_node from O(n square) to O(n)