Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is the algorithm in the data structure?

Shulou Source: shulou.com Published: 2022-06-03 02:52:55 11月02日 Update

What this article shares with you is about what the algorithm in the data structure is. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

What is a data structure?

Sartaj Sahni says in his book data structures, algorithms and applications: "A data structure is a data object and the various relationships between the instances that exist in the object and the data elements that make up the instance. These connections can be given by defining the relevant functions." He defines a data object as "a data object is a collection of instances or values."

The definition of Clifford A.Shaffer in the book data structure and algorithm Analysis is: "the data structure is the physical implementation of ADT (abstract data type Abstract Data Type)."

Lie data structure: a data structure is a collection of data elements that have one or more specific relationships with each other.

Grandma: the data structure includes the set of data objects and the way they are organized in the computer, that is, their logical structure and physical storage structure, as well as the set of operations related to the set of data objects. and the most efficient algorithms to achieve these operations.

Personal: is to convert the books in the library into some character data and store them in the computer, as well as the operation of these data object sets. Such as looking for books, putting books and so on.

What is an algorithm?

Or the example of the library, if a book looking for a tired person, if there is an index, which category to find first will be much faster. How to find it is actually an algorithm.

An algorithm is a finite set of steps to solve the problem, which is usually described by pseudo code in a certain computer language. Time complexity and space complexity are usually used to measure the advantages and disadvantages of the algorithm.

The five characteristics of the algorithm: input, output, finite, certainty and feasibility.

Input: zero or more inputs.

Output: one or more outputs.

Finite: completed in an acceptable time after a limited number of steps.

Certainty: each step has a definite meaning and has no ambiguity.

Feasibility: every step is feasible.

Algorithm design requirements: correctness, readability, robustness, high time efficiency and low storage.

Correctness: input and output, no ambiguity, correct answer.

Readability: easy to read.

Robustness: illegal input can be handled

High time efficiency and low storage: the lower the time and space complexity, the better.

These are the algorithms in the data structure, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Tags: Data structure algorithm data structure object input time output feasible complex instance that is step storage robustness one book between ambiguity element feasibility Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Apple Shulou Technology macOS Shulou Information