By Bruce D. At 8:30
Making:github.com/doukoi-BDB

Today’s topic:

  • 1, linked list, text + code to explain, vernacular way to talk about ~Copy the code
  • 2. Read 3 minutes, 936 words and 14 pictures.Copy the code

Theory – Introduction

First of all, the official standard theory we have to say anyway, otherwise it looks “unprofessional” hahaha. Online I often see a lot of excellent linked list articles, but how can less of my 8:30 technical station to write the soul of the article.

1. Official theory

A linked list is a non-sequential storage structure on a physical storage unit. The logical order implementation in data elements is achieved by pointing to the link order.

Linked lists are common data structures. One-way linked lists, two-way linked lists, circular linked lists and block linked lists can be constructed according to business requirements. The significance of linked lists is obvious, mainly to compensate for the shortcomings of arrays.

My theory

A linked list can be understood as a pointer, a data structure that points to itself, similar to multiple nodes (elements) composed of nodes. Each node is essentially an information field and a pointer field in a linked list. So to tell you, the information field is used to store data information, and the pointer field points to the next node.

I think you through these two ways to explain, I feel as a technology, more or less understand what is not the problem, specific thorough understanding, don’t look at the theory, combined with the code, remember to combine the code to learn comb.

Code – Practical

I’m from PHP, so I write PHP more easily, ha ha ha, take PHP for example.

First, the big picture:

PHP implementation of the linked list to add, delete, change and checkCopy the code

1. Start by defining a node class

2. Another list class

3. Call operations are as follows

I felt my way to a set of basic list (curd) write out the concrete practice, you can play it again combination theory, believe to be able to understand a 123, still don’t understand, you can read a book (data structures and algorithms), the first chapter is about the list, if still don’t understand the group communication bai, step by step, after all, are over.

Pay attention to the "8:30 technical station" public number received the update for the first time, GitHub source case will continue to iterate on the update, feel good to a star, there is a problem nuggets message.