Вы находитесь на странице: 1из 8

Data Structures II

Prepared By:
Assistant Lecturer: Ihsan Jabbar

1
Data Structures
• A data structure (DS) is a scheme for organizing data in the memory of a
computer.

• Data structure is representation of the logical relationship existing between


individual elements of data.

• Computer programmers decide which data structures to use based on the nature
of the data and the processes that need to be performed on that data.

Efficiency
• A solution is said to be efficient if it solves the problem within its resource
constraints.
– Space
– Time
• The cost of a solution is the amount of resources that the solution consumes.

2
What is Program
• A Set of Instructions
• Program = Data Structures + Algorithms
• Data Structure = A Container stores Data
• Algorithm = Logic + Control

• An algorithm is a step by step procedure to


solve a particular function.

3
characteristics of a good program
In general a good program should have the
following properties:

• Short code size


• High efficiency
• Low memory size and footprint
• High reliability

4
Selecting a Data Structure

Select a data structure as follows:


1. Analyze the problem to determine the resource
constraints a solution must meet.
2. Determine the basic operations that must be supported.
Quantify the resource constraints for each operation.
3. Select the data structure that best meets these
requirements.

Example
A queue is a good data structure to use for storing things that need
to be kept in order, such as a set of documents waiting to be printed
on a network printer.
5
Advantages of DS
1) Allows easier processing of data.
2) It allows information stored on disk very
efficiently.
3) These are necessary for designing an efficient
algorithm.
4) It provides management of databases like
indexing with the help of hash tables and arrays.
5) We can access data anytime and anywhere.
6) It is secure way of storage of data.

6
Disadvantages of DS
1) It is applicable only for advanced users.
2) Any problem involving data structure will
need an expert's help, i.e. basic users can not
help themselves.
3) Slow access in case of some data types

7
8

Вам также может понравиться