Vous êtes sur la page 1sur 5

Chapter 1

Important of Data Structure:


1-Representing information: is fundamental (main) to computer science.

2-computer programs: store and retrieves information.

3-storage space and running time, these programs should organize their
information in a way that supports efficient processing.
4-data structures and the algorithms that manipulate )‫(معالجه‬them is at the
heart of computer science.

data structure: is a data representation and its associated operations.


Examples:
•integer numbers.
•floating point numbers.
•arrays of these numbers.

Each data structure has associated)‫ (مرتبطين‬costs and benefits.

A data structure requires


–space for each data item it stores.
–time to perform a single basic operation.
–programming effort.

Each problem has constraints on:


1-available space

2-available time

Designed by Eng. Levi Ackerman


The best data structure for a problem:
- that allows the computer program to solve the problem efficiently )‫(بكفاءة‬in
terms of )‫ (من حيث‬the required:
1-storage
2- time

 Type: is a collection of values.


– For example, the (Boolean) type  consists of the values {True and False}.

 Data type: is a (type + a collection of operations) to manipulate the type.


– For example, an {integer variable} is a member of the(integer) data type.

 Data item: is a piece of information or a record whose value is drawn from a


type.

 Aggregate data item: is a complex data item that contains many data
items, probably their values are drawn from different data types.

 Abstract data type (ADT): defines)‫ (يحدد‬a data type in terms of:
1- a type
on that type
2- a set of operations

 An ADT doesn’t specify:


-how the data type is implemented)‫ (تُنفذ‬.

 Each operation is defined by


Designed by Eng. Levi Ackerman
its 1- inputs
2-outputs.

 Encapsulation: is the process of hiding implementation details.

Data structure: is the physical implementation of an ADT.

–Each operation associated )‫(مرتبطة‬with the ADT is implemented by one or more


subroutines)‫ (وظائف فرعيه‬.

–data structure  data stored in a computer's main memory.

Example:
•the mathematical concept of integer, along with operations that
1- manipulate )‫(معالجه‬integers.
2- form )‫(تشكيل‬an ADT.

 The C++ int variable type: is a physical representation)‫ (تمثيل‬of the


abstract integer.

 File structure: the organization of data on peripheral storage


such as
1- a disk drives
2- magnetic tape

 Data items have both a logical and a physical form.

1-The definition of the data item by an ADT is its logical form.


Designed by Eng. Levi Ackerman
2- the implementation of the data item within a data structure is its physical
form.

ADT defines the logical form of the data type.

 the data structure implements the physical form of the data type.

 Problem: is a task to be performed.

– It is best thought of as inputs and corresponding )‫(المقابلة‬outputs.

A problem definition

Designed by Eng. Levi Ackerman


1- should include constraints on the resources that may be used by an
acceptable solution
2- shouldn’t include any constraints on how the problem should be solved.

 Function: is a matching between inputs (the domain) and outputs (the


range).

-Values of the inputs are called the parameters of the function.


- all problems are functions.

 Algorithm: is a method or a process adopted in order )‫(تبني في ترتيب‬to solve a


problem.

- The algorithm takes the inputs of a certain )‫(معينه‬problem and transforms


them to the corresponding outputs of this problem.

– It is possible to find several different algorithms that can solve a certain


problem.

 Program: is an instance )‫(مثال‬of an algorithm in a certain programming


language.

 efficiency of an algorithm: how efficient )‫(مدي كفاءة‬this algorithm in use of


the available computer resources.

algorithm analysis: method can measure efficiency of an algorithm

Designed by Eng. Levi Ackerman

Vous aimerez peut-être aussi