Hanshunping _php software engineer Play algorithm Open Class (first quarter) 02_ single-linked list in memory form anatomy _ Learning Notes _ source code diagram _ppt document collation

Source: Internet
Author: User
Tags php language
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

  • 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.