What is a data structure?
Sartaj Sahni said in his book "Data Structures, Algorithms and Applications": "A data structure is a data object and the various relationships that exist between instances of the object and the data elements that combine to form an instance. . These connections can be given by defining related functions." He defined a data object as "a data object is a collection of instances or values."
Clifford A. Shaffer's definition in the book "Data Structure and Algorithm Analysis" is: "Data structure is the physical implementation of ADT (Abstract Data Type)."
Big words 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 how they are organized in the computer, that is, their logical structure and physical storage structure. It also includes the set of operations related to the set of data objects, and the methods to implement these operations. The most efficient algorithm.
Personal: It is to convert books in the library into some character data and store them in the computer, as well as to operate on these data object sets. Such as finding books, placing books, etc.
What is an algorithm?
Again, let’s take the example of a library. If it’s exhausting to search through each book, it would be much faster if there was an index to find which category to look for first. How to find is actually an algorithm.
An algorithm is a limited set of steps to solve a problem, usually described in pseudocode in a certain computer language. Time complexity and space complexity are usually used to measure the quality of an algorithm.
The five characteristics of algorithms: input, output, finiteness, certainty, and feasibility.
Input: Zero or more inputs.
Output: one or more outputs.
Finiteness: Completed within an acceptable time after finite steps.
Certainty: Each step has a definite meaning without ambiguity.
Feasibility: Every step is feasible.
Algorithm design requirements: correctness, readability, robustness, high time efficiency and low storage.
Correctness: There are inputs and outputs, no ambiguity, and correct answers.
Readability: Easy to read.
Robustness: illegal input can be processed
High time efficiency and low storage: the lower the time and space complexity, the better
The above is the detailed content of What is an algorithm in data structure?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment