java data structure (a)

Chapter One Introduction

1. What is a data structure?

In general, a solution to a specific problem with a computer, generally go through the following steps

  • Abstract an appropriate mathematical model
  • Design a solution once the data model algorithm
  • Programming
  • test
  • Debugging get answers
    to seek the essence of the mathematical model is to analyze the problem and extract the operation object, and find the relationships between objects, and then describe the language of mathematics., Which is divided into tables, trees, graphs.

2. The data structure of common terms

Data:
symbol represents objective things, in computer science refers to all be entered into the computer, and the computer program provide processed symbol general term for the raw material of his computer.
For example, by using a numerical analysis method for solving algebraic equations, which processed real number and is an integer; a compiler or processed word processing program for the computer is the string thus, extremely broad meaning of the data, such as images, sound and so can be attributed to the category of data by encoding.

Element:
is the basic unit of data, is typically considered as a whole and a processing program in a computer by a plurality of data elements. Data items consisting of ...

Data objects:
a set of data elements of the same nature, it is a subset of the data (character, number).

Data structures: (different versions have different interpretations No special definition)
exists in the collection of one or more data elements of a particular relationship between each data element is not isolated, but there is a relationship between them. , the relationship between such data elements called structure

The basic structure of conventional Class 4

  • Set: In addition to the relationship "belong to a set", there is no other relationships between data elements of the structure;
  • Linear structure: to-one relationship between the data structure elements;
  • Tree structure: the existence of a relationship between a plurality of data elements of the structure;
  • FIGS structure and a mesh structure a plurality of relationship between a plurality of data elements of the structure;

Logical structure:
describe the logical relationships between the data elements (a mathematical model abstracted from the operation target)

Structure of physical storage structure
data structure represented in a computer (image), and includes a representation showing the relationship between data elements.

Position
in the computer that is the smallest unit of information in a binary number.

& Element nodes
in the computer, we can use one or several in combination represent a bit string forming a data element (e.g., represented by an integer word length of a bit string, a character represented by 8-bit binary number, etc.) , then the string called an element or node

Data field
when data elements from the plurality of data items, the sub-bit string corresponding to a bit string called a data field of each data item. Therefore the element or node can be seen as the map data in the computer.

There are relationships between data elements of two different representations in a computer:

  • Image order
  • Non-sequential image

Obtained by the above two different data structures:

  • Sequential storage structure
  • Non-sequential storage structure

Image characteristic sequence:
means in a position opposite to the memory element to represent logical relationships between data elements.

Non-sequential image characteristics:
by reference storage address indicating element represents the logical relationship between data elements.

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

Data types are divided into two categories:

  • Atom type: type value is indivisible atoms such as (integer, character)
  • Structure type: type value of the structure is composed of several ingredients in certain structures, e.g. :( array)

Abstract data types:
refers to a mathematical model and a set of operations defined in the model of abstract data type definitions it depends only on the characteristics of a set of logic, but independent of how its inside computer, regardless of how both the internal structural changes. as long as the mathematical properties change will not affect its external utility.

A software module containing abstract data types typically should contain a definition, said implement portion 3.

Abstract data type definition, according to the different characteristic values, may be divided into the following three types.

  • Atom type: variable is indivisible. Such less abstract data types, because under normal circumstances, there are intrinsic data type sufficient to satisfy.
  • Fixed type of polymerization: is the type of variable, whose value is determined by the number of ingredients in the composition, for example, a certain structure, a plurality of two real numbers are determined by the order relationship thereof.
  • Variable aggregate type: fixed type polymerization comparing the value of the variable constituting the aggregation type is variable.

Polymorphic data types:
means that it is undefined value data type

3. algorithms and algorithm analysis

Algorithm:
a description of the steps to solve a particular problem, he be a finite sequence of instructions, where each instruction represents one or more operations;
a method further comprises a five important characteristics:

  • Finite nature: an algorithm must always (for any legitimate input values) after the end of the implementation of finite steps, and each step can be completed within a finite time.
  • Uncertainty: the algorithm in each instruction must have a precise meaning, the reader does not produce ambiguity when understood and under any conditions, there is only one algorithm execution path that can only come to the same for the same input. output.
  • Feasibility: an algorithm can do it, i.e. the algorithm described operations are performed may be implemented by a finite number of basic operations has been achieved.
  • Input: An algorithm has zero or more inputs, which are set depending on certain objects.
  • Output: An algorithm has one or more outputs that are the same input has a specific relationship.
Published 69 original articles · won praise 6 · views 2505

Guess you like

Origin blog.csdn.net/qq_40539437/article/details/103973438