3 ms·
Pet peeve: The example linked list implementation suffers from not using double-pointers (or pointers-to-pointers). For example, when the "special case" of add
by nhaehnle 10y ago
Pet peeve: The example linked list implementation suffers from not using double-pointers (or pointers-to-pointers).
For example, when the "special case" of adding an element at the head or tail are discussed - those special cases disappear entirely when the search procedure simply returns a pointer to the next field of the preceding element (or a pointer to the root pointer of the linked list, if the new element should be inserted at the head).