Just to point out, node 6 still exists and is pointing to 10 but it's just that 5 is no longer pointing to 6. So there is no way of finding 6.
Note that this would not only corrupt your list, but would also lead to a memory leak, as @flyne says.
Just to point out, node 6 still exists and is pointing to 10 but it's just that 5 is no longer pointing to 6. So there is no way of finding 6.
Note that this would not only corrupt your list, but would also lead to a memory leak, as @flyne says.