Overview of data structures and algorithms

Source: Internet
Author: User
Tags array length

1 Concepts of data structures and algorithms
    • Data structure: a kind of arrangement for computer memory.
    • Algorithm: The data in the structure of a variety of processing.

2 application aspects of data structures and algorithms
    • ① real-World data storage
    • ② Programmer's Tools
    • ③ modeling of the real world

3 common data structures and pros and cons
    • Array
      • Pros: Insert fast (know subscript), Find Fast (find by index)
      • Cons: Lookup slow (based on content lookup), delete slow, array length is fixed
    • Ordered array
      • Pros: Find blocks than unordered array
      • Cons: Delete and insert slowly, the length of the array is fixed
    • Stack
      • Advantage: Provide last-in-first-out access mode
      • Cons: Accessing other items is slow
    • Queue
      • Advantages: Provide first-in, out-of-the-way access
      • Cons: Storing other items is slow
    • Linked list
      • Advantages: Quick Insert and delete
      • Cons: Find slow
    • Two-fork Tree
      • Pros: Find, insert, delete faster (in case of tree balance)
      • Cons: Deleted algorithms are more complex
    • Red and black tree (balance tree)
      • Pros: Find, insert, and delete are quick
      • Cons: Algorithmic complexity
    • 2-3-4 Tree (Balance tree)
      • Pros: Find, insert, and delete are quick
      • Cons: Algorithmic complexity
    • Hash table
      • Advantages: Quick Insert, get value by key fast
      • Cons: Deleting a key without knowing it is relatively slow
    • Heap
      • Advantages: Fast insertion and deletion, fast access to maximum data items
      • Cons: Slow access to other data items
    • Figure
      • Pros: Modeling the real world
      • Cons: Some algorithms are slow and complex

Overview of data structures and algorithms

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.