# What’s in Data Structures and Algorithms

### Basic Concepts of Data Structures and Evaluation of Algorithms and Algorithms

1. Basic Concepts and Terminology

Data: data is the carrier of information, a collection of numbers, characters, and all the symbols that can be entered into a computer to describe the properties of an objective matter and be recognized and processed by a computer program

Data Element: a data element is the basic data unit, usually considered and processed as a whole

Data object: a data object is a collection of data elements with the same properties, a subset of data

Data type: a data type is a general term for a collection of values and a set of operations defined on this collection

Categories:

Atomic type: a data type whose values are not subdividable

Structural type: a data type whose values can be subdivided into a number of components (parts)

Abstract data type: an abstract organization of data and the operations associated with it

Data structure: a data structure is a collection of data elements that have one or more specific relationships to one another

Data structure consists of three aspects: logical structure, storage structure, and operation of data

2. Three elements of data structure

Logical structure of data: logical structure refers to the logical relationship between the data elements, i.e., describing the data in terms of the logical relationship has nothing to do with the storage of the data, and it is independent of the computer

Categories:

Linear structure : linear tables, stacks, queues, arrays

Non-linear structures: sets, trees, graphs

Storage structure of data: the storage structure is the representation (also known as the image) of the data structure in the computer, also known as the physical structure. Representation of data elements and representation of relationships. A storage structure is a logical structure implemented in a computer language, which depends on the computer language

Categories: sequential storage, chained storage, indexed storage, hash storage

Operations on data: operations imposed on data include the definition and implementation of operations. The definition of an operation is specific to the logical structure and indicates the function of the operation. The implementation of an operation is specific to the storage structure and indicates the specific steps of the operation.

3. Basic Concepts of Algorithms

An algorithm is a description of the steps involved in the solution of a particular problem; it is a finite sequence of instructions, each of which represents one or more operations

Important Characteristics: Infinity, Determinism, Feasibility, Inputs, and Outputs

Criteria of a Good Algorithm Criteria: correctness, readability, robustness, efficiency and low storage requirements

4. Metrics of algorithmic efficiency

Measures of algorithmic efficiency are described by time complexity and space complexity

Time complexity: the frequency of a statement is the number of times the statement is repeatedly executed in an algorithm

Space complexity: the space complexity of an algorithm, S(n), is defined as the amount of storage space consumed by the algorithm, which is a function of the problem size, n

A program, when executed, requires storage space for the instructions, constants, variables, and input data used in its own execution, as well as units of work to manipulate the data and auxiliary units for storing the information needed to implement the computation.

Algorithms work in situ in the sense that the amount of auxiliary space required by the algorithm is constant, i.e., O(1)

### Knowledge of data structures and algorithms?

For most programmers, when learning techniques such as data analysis need to first understand the knowledge points about data structures as well as algorithms, below we will give you a brief introduction to what is a data structure? What are algorithms?

Most data structures and algorithms textbooks give a clear definition of these two concepts at the beginning. However, these definitions are very abstract and do not substantially help in understanding these two concepts, but instead will let you fall into the misunderstanding of sticking to the definitions. After all, we are studying now, not for the exam, so it is of little use to memorize the concepts as well as not being able to use them.

While we say that there is no need to dig deep into strict definitions, this is not the same as not needing to understand the concepts. Below I’ll help you understand the concepts of data structures and algorithms at both the broad and narrow levels.

In a broad sense, a data structure is a set of structures for storing data. An algorithm is a set of methods for manipulating data.

Surely you’ve seen libraries storing books, right? In order to make it easier to find, librarians usually “store” books in different categories. The books are numbered according to a certain pattern, which is the storage structure of this “data”.

How do we find a book? There are many ways, of course, you can find one by one, you can also be based on the number of the book category, is the humanities, or science, computers, to locate the bookshelf, and then in turn to find. In general terms, all of these finding methods are algorithms.

From the narrow sense, that is, our column to talk about, refers to certain well-known data structures and algorithms, such as queues, stacks, heaps, binary lookups, dynamic programming and so on. These are the crystallization of the wisdom of previous generations, and we can use them directly. These data structures and algorithms we are going to talk about are abstracted from many practical operational scenarios by previous generations, and after very much seeking and testing, they can efficiently help us to solve a lot of practical development problems.

What is the relationship between data structures and algorithms? Why do most books put them together?

This is because data structures and algorithms go hand in hand. Data structures serve algorithms, and algorithms work on top of specific data structures. Therefore, we can’t talk about algorithms in isolation from data structures, nor can we talk about data structures in isolation from algorithms.

For example, because the array has the characteristics of random access, the commonly used binary search algorithm needs to use the array to store data. But if IT training chooses a data structure like a chained table, the binary lookup algorithm won’t work because chained tables don’t support random access.

The data structure is static; it is just a way of organizing data. A data structure that exists in isolation is useless if you don’t manipulate and build algorithms on top of it.

### What aspects of data structure are included?

Data structure is an important discipline in computer science, which consists of the following aspects:

Logical structure of data: the logical structure of data refers to the way in which data is stored and processed within the computer. For example, integer data is stored in memory as binary complement, and string data is stored as character encoding.

Physical structure of data: The physical structure of data refers to the way in which data is stored and transmitted within the computer. For example, integer data is stored as binary bits inside the computer, and string data is stored as characters, which need to be manipulated and transmitted using certain data structures.

Algorithm: an algorithm is a set of rules and steps to solve a particular problem. Algorithms are very important elements in data structures as they help us to realize various data structure operations and applications.

Categorization of Data Structures: data structures can be categorized according to different criteria. For example, according to the way of storing data, data structures can be categorized into sequential structures, linked structures, indexed structures and so on; according to the complexity of data structures, data structures can be categorized into simple structures, complex structures, heap structures and so on.

Applications of Data Structures: data structures have a wide range of applications in computer science. For example, in programming languages, data structures are important basics; in databases, data structures are important data storage and manipulation tools; in computer graphics, data structures are important graphics processing tools.

### What is the knowledge related to data structure algorithms?

Input: an algorithm has zero or more outputs. In order to portray the initial situation of the object of the operation, the term zero inputs means that the algorithm itself sets out the initial conditions. The latter phrase translates to mean that an algorithm can have no outputs if the algorithm itself gives the initial conditions. For example, print the sentence: NSLog. output: the algorithm has at least one output. That is, the algorithm must have an output. The output can be in the form of a printout, or it can return a value or multiple values, etc. It can also display some kind of hint. It can also display some hints. Infinity: the execution steps of the algorithm are finite, and the execution time of the algorithm is also finite. Deterministic: each step of the algorithm has a definite meaning and there is no dichotomy. Feasibility: the algorithm is usable, that is, it is able to solve the problem at hand. The design of an algorithm depends on the (logical) structure of the data, while the implementation of the algorithm depends on the storage structure employed. The storage structure of data is essentially the realization of its logical structure in computer memory. In order to fully reflect the logical structure of a piece of data, its image in memory consists of two aspects, i.e., the information between data elements and the relationships between data elements. Different data structures have their corresponding several operations. The operations of data are algorithms of operations defined on the logical structure of data, such as retrieval, insertion, deletion, updating and sorting. The operations on data are an important aspect of data structures, and no discussion of any data structure can be separated from a discussion of the operations on that structure and the algorithms that implement them. A data structure is different from a data type and from a data object in that it not only describes the data object of the data type, but also describes the interrelationships between the elements of the data object.

A data type is a general term for a set of values and a set of operations defined on that set of values. Data types can be divided into two categories: atomic types, and structural types. In a programming language, every piece of data belongs to a certain data type. The type specifies, either explicitly or implicitly, the range of values the data can take, how it can be stored, and the operations it is allowed to perform. Data types can be thought of as data structures that have been implemented in program design. When some new data structure needs to be introduced during the programming process, the storage structure of the data is always described with the help of the data type provided by the programming language. BASE-BAND SIGNAL: A raw electrical signal that is not modulated (subjected to spectral shifts and transformations). Baseband communication (also known as baseband transmission): refers to the transmission of baseband signals. The system that performs baseband transmission is called a baseband transmission system. The entire channel of the transmission medium is occupied by a baseband signal. Baseband transmission does not require a modem, small equipment costs, has the advantages of high rate and low bit error rate, etc.,. Suitable for short-distance data transmission, transmission distance of 100 meters, in the audio city phone, computer network communications are widely used.