go to previous page   go to home page   go to next page highlighting

Answer:

The answer to some of the design questions depends on what the list is expected to be used for. But reasonable answers are:


delete

The pictures show two situations.

Two pointers traverse the list, one behind the other, until the leading pointer (next) encounters the node to be deleted. Then that node is unlinked from the node current points to.

Search for a proper gap

QUESTION 15:

With insertInOrder() had four cases. What cases are there with delete() (not all are shown in the picture)?


go to previous page   go to home page   go to next page