Basic operations for a one-way list-Create, insert, delete

Source: Internet
Author: User

I. Basic concepts of linked lists

Single linked list: The structure of N nodes linked into a chain linear table is called a linked list, and when each node contains only one pointer field, it is called a single-linked list

Header node: The first node in a linked list, containing pointers to the first data element and some information about the list itself, such as length, etc.

?? Data node: A node in a linked list that represents a data element, containing a reference to the next data element

?? Tail node: The last data node in a linked list, the next element pointer is empty, indicating no successor .

Two. Definition of linked list

Due to the convenience of the leading list operation, all the operations described below are based on a single linked list of the header nodes.

1. Definition of linked list

1 /*  */2struct  list3{4     int data;          // data fields 5     struct // pointer Field 6 }linklist;
View Code

Basic operations for a one-way list-Create, insert, delete

Related Article

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.