Common applications of typical data structures

Source: Internet
Author: User
The data structure is used to store information, while Algorithm Is used to operate data. Frequently used methods for storing information: arrays, linked lists, indirect addressing, and analog pointers, among which several arrays and linked lists are the most common. Many complex data structures are implemented based on arrays and linked lists, so learning the two is very important for learning data structures.
Array
Arrays are suitable for applications that require fast search, insertion, and deletion of elements. NOTE: If static arrays are used, there is a capacity limit. If you Program Performance is very concerned, so even if you use a large array, it is a waste, do not use Dynamic Linked List, otherwise the cost of malloc and free is enough for you.
Linked List
The linked list is suitable for applications that often insert or delete objects but do not search for many objects. One of the more attractive aspects of the linked list is its dynamic adaptability, but it also brings performance loss.
Stack
A stack is a data structure of "LIFO -- last in first out". That is to say, the elements you get from the stack are the one you just put in. This feature is especially suitable for tasks with multiple sub-tasks. Common applications include: 1) Saving the return address, parameters, and local variables of subprograms during function calls; 2) matching parentheses in processing expressions; 3) when the compiler analyzes the syntax, it is used to save the mark of various syntax elements; 4) Non-Recursive Implementation of recursive functions.
The underlying implementation of the stack is commonly used as a dynamic array or linked list.
Queue
....
Tree
....
Figure
....
Set
....

 

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.