2-6-static linked list-linear table-Chapter 2nd-source code of the data structure textbook-yan Weimin Wu Weimin edition, 2-6-Data Structure

Source: Internet
Author: User

2-6-static linked list-linear table-Chapter 2nd-source code of the data structure textbook-yan Weimin Wu Weimin edition, 2-6-Data Structure

Textbook source code

Chapter 2 linear table-static linked list

-- Data Structure-yan Weimin. Wu Weimin

Source code instructions☛☛☛Data Structure-C language version (Yan Weimin, Wu Weimin version) Textbook source code + EXERCISE set parsing instructions

Textbook source code compilation Link☛☛☛Data Structure textbook source code compilation

Question set full resolution Link☛☛☛Analysis and compilation of data structure question set

 

File links introduced in this source code☛Status. h

Test data download link☛No data

 

Source code and test data storage directory in the document: Data Structure \ ▲textbook Algorithm Implementation \ ▲02 linear table \ 06 static1_list

 

Overview

Static linked lists use arrays to store data. The access method simulates the system's malloc allocation and free collection mechanisms.

Analysis

In the original book "Data Structure", the expression of the static linked list is somewhat complicated. Here it is simplified, but the central idea remains unchanged.

A static linked list is a special sequence table. It is generated from an array (a continuous memory), but its behavior is similar to a single-chain table, it reflects the essence of chain-linked single-chain tables in the system. The static linked list relies on its own cursor to implement the structure pointer of a single-chain table. Therefore, when accessing elements, consider the internal cursor changes in the static linked list, on the other hand, we also need to consider the changes in the remaining memory in the entire space, because the entire memory block is also linked through the cursor.

The static linked list storage structure and access mechanism are as follows:

Possible syntax difficulties

Flexible application of typedef to create new types. For example, when defining a static SPACE, the entire structure array is regarded as a new type Component.

Source code File 1☛StaticLinkedList. h

File 2☛Staticemedilist. c

File 3☛StaticLinkedList-main.c (test documentation)

Test Result Display

 

Updating more chapters...

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.