Han Shunping _ PHP software engineer fun algorithm open course (first season) 02 _ single-chain table in memory exist Form Analysis _ learning notes _ source code illustration _ PPT document arrangement

Source: Internet
Author: User
Tags php software
Han Shunping _ PHP programmer fun algorithm open course (first season) 02 _ single-chain table in memory exist in the form of analysis _ learning notes _ source code illustration _ PPT document finishing text West Malone: Workshop. Content 1. what is a linked list 2. one-way link Han Shunping _ PHP programmer fun algorithm open class (first season) 02 _ single-chain table in memory exist Form Analysis _ learning notes _ source code illustration _ PPT document sorting

Wen Xi Malone: http://blog.csdn.net/wenximalong/

Linked list-the most flexible data structure
It is convenient to use linked lists to solve complex problems and algorithms.

Content
1. what is a linked list?
2. one-way linked list
3. two-way linked list
4. circular linked list
5. Solve the Joseph problem by using a circular linked list

Linked list-what is a linked list
The linked list is an ordered list, but it is stored discretely in the memory.

Linked lists are everywhere,For example, in an operating system, the link between a file and a file is linked by a linked list.
Using a linked list can solve problems like Joseph, sorting, indexing, binary trees, and generalized tables...

Linked list-quick start to a single-chain table
Use the one-way linked list of the head header to implement hero ranking management

Php is used for implementation. if it is c #/c ++/java,The idea is the same.

Now let's look at what kind of data structure is linked list? -> Memory graph analysis

SingleLink. php

 One-Way linked list for hero ranking management
 Query heroes add heroes delete heroes modify heroes
 No = $ no; $ this-> name = $ name; $ this-> nickname = $ nickname ;}// some students are not familiar with PHP syntax, I will demonstrate // create a hero $ Hero = new hero (1, 'songjiang ', 'timely Rain'); // echo outputs echo $ hero-> name;?>
Memory analysis diagram

The picture is large. open the picture in a new window to view the complete picture.

The underlying layer of PHP is c. when a program runs,Memory is divided into five zones [Stack zone/heap zone/Global Zone/constant zone/code zone]
Once a program is run, how is things distributed in these five zones,Be very clearOtherwise, it will be confused.
C/c ++/java: The same is true for their memory analysis, because this is the underlying thing.


Han Shunping _ PHP programmer fun algorithm open course _ learning notes _ source code illustration _ PPT document arrangement _ Directory

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.