4 ms·
The trick employed by the "good taste" solution is to ignore the type of the object containing the pointer, which is different for the head, and focus only on t
by warmfuzzykitten 6y ago
The trick employed by the "good taste" solution is to ignore the type of the object containing the pointer, which is different for the head, and focus only on the type of the object pointed to, which is the same for all the pointers. This frame of reference shift makes the solution look tricky to people unaccustomed to working with pointers, or languages in which pointers are not explicitly represented. It is also not quite true, as the pointer in the last element in the list does not point to a list element.