The head node, the head pointer and the first element nodes of the soft exam item

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.