Data structure Tutorial First lesson the basic concepts and terminology of data structure

Source: Internet
Author: User
Tags definition data structures

topic: Basic concepts and terminology of data structure

Teaching Purpose: understand the basic concepts of data structure, understand common terminology

Teaching Focus: Basic concepts: data and data elements

teaching Difficulties: Four kinds of structural relationships among data elements.

Teaching Content:

The definition of data, data element, data object and structure

1, the definition of data

Definition One: The data is the symbolic representation of the objective thing.

School Number Name Chinese Mathematical C language
6201001 Tom 85 54 92
6201002 John doe 92 84 64
6201003 Harry 87 74 73
6201004
...

Example: John's C language test score is 92 points, 92 is the student's performance data.

Definition two: The general name of a symbol that can be entered into a computer and processed by a computer program.

Examples: images, sounds, and so on.

Conclusion: The analysis, reproduction and dissemination of real world information should be symbolized first, so that it is easy to deal with, especially for computer. Parents, the community to understand a student's academic performance and ability, depends on his study file, and the study file is to explain the student's learning data.

2, data elements, data items

A data element is the basic unit of data, and it can be made up of indivisible data items. As illustrated:

3. Data Object

is a collection of data elements of the same nature. As in the previous example: A Class score table can be considered as a data object.

4. Data structure

Defines the relationships of elements in a collection of data elements (also known as data Objects).

Defines a collection of data elements that have a specific relationship between each other.

Types of data structures:

Characteristics Example
Collection Loose relationships between elements
Linear structure A strict one-to-one relationship between elements As the elements in the score sheet above
Tree-shaped structure A strict one-to-many relationship between elements
Graphic structure (or mesh structure) A many-to-many relationship between elements

form definition of data structure:

Data structure name = (d,s)

where D is a finite set of data elements, S is a finite set of relations on D

Logical Structure The "relationship" in the definition of "data structure" refers to the logical relationship between data, so it is also called the structure of logic.
Storage structure The representation of a data structure in a computer is called a physical structure. Also known as the storage structure.
Sequential storage structure
Chain-type storage structure

Storage structure Detailed:

The smallest unit of information stored in a computer: bits, 8 bits in one byte, two bytes in one word, and bytes, words, or more bits can be called bit strings. In the logical description, the bit string is called an element or node.

When a data element consists of several data items, the substring of a bit string that corresponds to each data item is called the data field.

Example: The above results table data are stored in the C language structure array classonestu[50]:

struct Stu {
int stuno;/* data item, also called a Stu string in a bit string, or a data field.
Char name[20];
int maths;
int language;
int c_language;
} CLASSONESTU[50];

Ii. Types of data

1. Definition: A data type is a collection of values and a generic term for a set of operations defined on this set of values.

Example: the integral type in C language, its intension is a certain range of natural number set, and define on this set of subtraction and modulus, compare size operation. And the real type has no modulo operation. Of course, the integral type does not need rounding.

2. Type of data:

Characteristics Cases
Atomic type Value is logically not decomposed int float
Structure type The value is composed of a number of components according to some structure struct STU

Data types encapsulate specific details of data storage and operations.

Third, summary

Data-> Data Elements

Set of data elements with specific relationships-> structure

Logical representation of data structure and physical storage-> logical structure and storage structure

People not only care about the logical structure of data, storage structure, but also care about the data processing method (algorithm) and processing result-> data type

Data type-> classification

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.