題組內容

3.(20%) Given a doubly linked list which has a header field for the dummy head node and a trailer field for the dummy tail node. Suppose that each node has a next field for the next node and a prev field for the previous node. Please complete the following task with proper pseudo code.

a. What are the conditions for testing if the list has exactly 1 and 2 data nodes respectively?