Hanshunping _php Programmer Open Class (first quarter) 02_ single-linked list in memory form anatomy _ Learning Notes _ source code illustration _ppt document collation
Vencimaron:http://blog.csdn.net/wenximalong/
Linked List-The most flexible data structure
It is convenient to solve complex problems and algorithms with linked lists.
Content Introduction
1. What is a linked list
2. One-way linked list
3. Doubly linked list
4. Ring Linked List
5. Using the ring list to solve the Joseph problem
Linked List-What is a linked list
A linked list is an ordered listing, but it is distributed in memory.
linked lists are ubiquitous, such as in the operating system, between files and files, between file blocks and file blocks, and by chain links.
The use of linked lists can solve similar Joseph problems, sort, index, binary tree, generalized table ...
Linked List-A quick start for a single linked list
A one-way linked list using head head--the management of Heroes ' leaderboard
Using the PHP language to implement, if it is C#/c/c++/java, the idea is exactly the same.
Now let's look at what kind of data structures are linked lists? Memory Graph Analysis
singlelink.php
One-way linked list to complete the hero ranking management
Query Heroes Add heroes to delete Heroes
no= $no $this->name= $name $this->nickname= $nickname;}} Because some students, a bit unfamiliar with PHP syntax, I demo//create a Hero $hero=new Hero (1, ' Song Jiang ', ' timely rain ');//echo output echo $hero->name; >
Memory Analysis Diagram
Big picture, open the picture in a new window, watch the full picture
The bottom of PHP is C, when a program runs, memory is divided into five zones [stack/heap/global/constant/code area]
Once the program runs, how things are distributed in these five areas, it is very clear , otherwise it is a group of fog.
C/c++/java their memory analysis diagrams are usually painted in this way, as this is the bottom of the story.
Hanshunping _php Programmer Play Algorithm Public Lesson _ Learning Note _ Source code diagram _ppt Document Sorting _ Directory