Met with a confusing topic.
The following is a description of the delete node operation for a linear table with chained storage, which is correct ()
A. When you delete a node from a linear list of leading nodes, you do not need to change the head pointer.
B. A linear list of leading nodes when you delete the first node, you need to change the head pointer.
C. When you delete a node from a linear list without a lead node, you need to change the head pointer.
D. A linear list without a lead node when you delete the first node, you do not need to change the head pointer.
First, define several concepts.
First node: A node in a linked list that stores the first data element A1.
Head node: It is to facilitate the operation of the node in front of the first node to be re-set.
Head pointer: A pointer to the first node in the list (or the head node or the primary node).
Because the head node cannot be deleted, and the first node of the linear list with the lead node is the head node, B is wrong, and a is correct.
Because a linear list that does not take the lead node, you need to change the head pointer only when you delete the first node, that is, the first element node. If you delete other nodes, you do not need to change the head pointer.
So C and D are all wrong.
The head node, the head pointer and the first element nodes of the soft exam item