DS Introduction

First, the basic concept

  • Data: all symbols for input into the computer and the computer program for processing a generic name, computer processing "material."
  • Element: is the basic unit of data, it is typically considered as a whole and processed in a computer program.
  • Data items: a data element may be composed of a plurality of data items. Data entry is indivisible smallest unit of data.
  • Keywords: can identify one or more data items of data elements. If it can play a unique role in identifying, then known as the "master" key, otherwise known as "secondary" keyword.
  • Data objects: is a collection of data elements of the same nature, is a subset of the data.
  • Data structure: There is a collection of one or more data elements of a particular relationship to each other.

The basic structure of four categories:

  • Collection: intermediate data elements other "belong to a set of" outside, no other relationships.
  • Linear structure: exists between a data element of a relationship.
  • Tree: the data element is present among a plurality of relationships.
  • Graph structure: a plurality of relationships between a plurality of data elements present.

Logical structure : a description of the logical relationships between data elements. It may be represented by a set of data elements and defining a plurality of relationships in this collection.

The physical structure / storage structure : represents the logical structure of data and implement in the computer. Mapping and mapping relationships contain data elements.

There are two basic elements of the data structure stored in a computer, they are sequentially stored in storage structure and chain structure.

  • Sequential storage structure: the logically adjacent nodes stored in the physical location of adjacent memory cells, the logical relationships between the nodes be embodied by abutting relationship storage unit. Usually by means of sequential storage array structure to describe the language.
  • Storage Structure: does not require logically adjacent neighbor node is also physical, logical relationship between nodes is represented by an additional pointer field. Usually by means of a pointer type of language to describe.

Data type is set and all the operations defined in the value of a set value. For example, int.

Abstract data type is a mathematical model refers to a well defined set of operations on the model. It comprises three parts: a set of data objects, the object-relational data base and a set of operations on data objects. While the data abstraction and data encapsulation are two important characteristics of abstract data types.

Second, on the algorithm

Algorithm (Algorithm) is a description of the steps to solve a specific problem, which is a finite sequence of instructions.

Characteristics algorithm

  • Finite nature: an algorithm is always required after performing a finite end step, and each step can be completed within a finite time.
  • Uncertainty: Each algorithm execution must have a precise meaning, the algorithm executed or reader no ambiguity. And in any conditions, algorithms are only one execution path.
  • Feasibility: All operations in the algorithm must be sufficiently basic, can be achieved through the basic operations of a limited number of operations has been achieved.
  • Input: zero or more inputs.
  • Output: one or more outputs.

The evaluation algorithm - the standard measure of the merits of the algorithm: correctness (correctness), readability (readability), robustness (robustness), efficiency and low storage capacity.

Time complexity / spatial complexity : estimated time complexity algorithm is repeatedly executed the number of times the basic operation of the algorithm, in the frequency or in the deepest statement cycle. Space complexity of the algorithm depends on input and auxiliary variables algorithms footprint.

Guess you like

Origin www.cnblogs.com/lin546/p/11980931.html