Git Product home page Git Product logo

data_structure_learn's Introduction

数据结构

线性表 (Linear List)

线性表就是数据排成像一条线一样的结构,每个线性表上的数据最多只有前和后两个方向。数组,队列,链表,栈都是线性表结构。

image

非线性表

二叉树、堆、图等都是非线性,因为在非线性表中,数据之间并不是简单的前后关系。

image

数组 Vs 链表

image

数组简单易用,实现上使用的是连续的内存空间,可以借助 CPU 的缓存机制,预读数组中的数据,所以访问效率更高,而链表在内存中并不是连续存储,所以对 CPU 缓存不友好,没有办法有效预读。

数组的缺点是大小固定,一经声明就要占用整块连续内存空间,如果声明过大数组则导致,“内存不足(out of memory)”。链表本身没有大小的限制,天然地支持动态扩容。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.