Você está na página 1de 20

ADMAS UNIVERSITY ICT Department

LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND


DATA STRUCTURE & ALGORITHMS

INTRODUCTION TO DSA

To make a computer do anything, you have to write a computer program. To write a computer
program, you have to tell the computer, step by step, exactly what you want it to do. The computer then
"executes" the program, following each step mechanically, to accomplish the end goal.

When you are telling the computer what to do, you also get to choose how it's going to do it.
That's where computer algorithms come in. The algorithm is the basic technique used to get the job done. Let's
follow an example to help get an understanding of the algorithm concept.

Let's say that you have a friend arriving at the AIRPORT, and your friend needs to get from
the airport to your house. Here are four different algorithms that you might give your friend for
getting to your home:

The taxialgorithm:
1. Go to the taxi stand.
2. Get in a taxi.
3. Give the driver my address.

The call-me algorithm:


1. When your plane arrives, call my cell phone.
2. Meet me outside baggage claim.

The rent-a-car algorithm:


1. Take the shuttle to the rental car place.
2. Rent a car.
3. Follow the directions to get to my house.

The bus algorithm:


1. Outside baggage claim, catch bus number 70.
2. Get DOWN on GEAT HOSPITAL .
3. Walk two blocks north to GEAT HOSPITAL.

All four of these algorithms accomplish exactly the same goal, but each algorithm does it in
completely different way. Each algorithm also has a different cost and a different travel time. Taking a taxi, for
example, is probably the fastest way, but also the most expensive. Taking the bus is definitely less expensive, but
a whole lot slower. You choose the algorithm based on the circumstances.

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE -1-


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

In computer programming, there are often many different ways -- algorithms -- to


accomplish any given task. Each algorithm has advantages and disadvantages in different
situations. Sorting is one place where a lot of research has been done, because computers spend
a lot of time sorting lists. Here are five different algorithms that are used in sorting:

1. Bin sort
2. Merge sort
3. Bubble sort
4. Shell sort
5. Quick sort
If you have a million integer values between 1 and 10 and you need to sort them, the
bin sort is the right algorithm to use. If you have a million book titles, the quick sort might be the
best algorithm. By knowing the strengths and weaknesses of the different algorithms, you pick the
best one for the task at hand.

How do you represent an algorithm?

Algorithm representation: The most obvious representation of an algorithm is the source


code. However, writing source code before you fully understand an algorithm often leads to difficulty in
finding bugs or errors. One technique for overcoming those bugs involves flowcharts.

A flowchart : is a visual representation of an algorithm's (steps or instructions to follow) control flow in


a graphical format. That representation illustrates statements that need to execute, decisions that need
to be made, logic flow (for loop & decision making and other purposes), and terminals that indicate start
and end points. To present that visual representation of an algorithm , a flowchart uses various symbols:

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE -2-


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

A flowchart's advantages include its simplicity and its ability to present an algorithm's
control flow visually. Flowcharts also have disadvantages:

Highly-detailed flowcharts can introduce errors or inaccuracies.


Extra time is required to position, label, and connect a flowchart's symbols, even though tools
speed up this process. This delay might slow your understanding of an algorithm.
Because flowcharts are tools of the structured programming era, they aren't as useful in an
object-oriented context. The Unified Modelling Language (UML) is more appropriate for providing
object-oriented visual representations.

An alternative to flowcharts is source code: a textual representation of an


algorithm that approximates the final source code.

Data structure and algorithm basics

Before we explore specific data structures and algorithms, we need to examine three basic questions:

Q1- What is an ALGORITHM?

Q2- What is a DATA STRUCTURE?

Q3- How do you REPRESENT AN ALGORITHM?

Knowledge of those concepts helps you understand DSA.

Definition of an Algorithm:

Algorithms are used In mathematics and computer science, an algorithm


is an effective method expressed as a finite list of well-defined instructions for calculating
a function. Algorithms are used for calculation, data processing, and automated
reasoning.

Definition 2 of an Algorithm:

Algorithms are the processes that perform a series of operations from


beginig to an end. Algorithms can be expressed in many ways, in flow charts, a natural
language, and computer programming languages. Algorithms are used in mathematics, computing .

Starting from an initial state and initial input (perhaps null), the instructions of an algorithm
describe a computation that, when executed, will proceed through a finite number of well-defined
successive states, for the purpose or for eventually producing (output) and terminating at a final ending
state (the result or solution). The transition from one state to the next is not necessarily deterministic
accurate because there can be a control statements for the decision making (loop,switch,list ...etc) ; some
algorithms, known as randomized algorithms, incorporate random input.

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE -3-


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

More than one algorithm might work to perform the same operation & find the
solution for a task, but some algorithms use more memory and take longer to perform than others.
Also, how do we know how well algorithms work in general, given differences between computers and data
inputs? This is where algorithm analysis comes in.

One way to test an algorithm is to run a computer program and see how well it
works. The problem with this approach is that it only tells us how well the algorithm works with a
particular computer and set of inputs. The purpose of algorithm analysis is to test and then draw conclusions
about how well a particular algorithm works in general. This would be very difficult and time consuming to do on
individual computers, so researchers devise models of computer functioning to test algorithms.

In general, algorithm analysis is most concerned with finding out how much time a
program takes to run, and how much memory storage space it needs to execute the program. In
particular, computer scientists use algorithm analysis to determine how the data imputed into a
program affects its total running time, how much memory space the computer needs for program
data, how much space the programs code takes in the computer, whether an algorithm produces correct
calculations, how complex a program is, and how well it deals with unexpected results.

Definition of a Data Structure (DS) :

A data structure: is an arrangement of data in a computer's memory (main memory & register
memory) or even disk storage. An example of several common data structures are arrays, linked lists,
queues, stacks, binary trees, and hash tables. Algorithms: on the other hand, are used to manipulate the
data contained in these data structures.

IMPORTANT NOTE:

Many algorithms (steps or well-defined instructions) apply directly to a specific data


structures on a computer memory. When working with certain data structures you need
to know TO INSERT NEW DATA?, SEARCH FOR A SPECIFIED ITEM?, and DELETING A
SPECIFIC ITEM? [ that means knowing how to use that type of an application such as C++,
JAVA, C#, VISULA STUDIO.........etc ].

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE -4-


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

Commonly used algorithms include the following useful things to be used for:
1. Algorithm for searching in the database for a particular data item (or record).
2. Algorithm for decision making of an application that helps in telling application what
decision to take depending on the input that the user gives the programme such as IF
statements in some programming languages.
3. Algorithm for iterating through some items in a data structure (DATA IN MEMORY). That
helps in telling application what decision to take depending on the input that the user gives
the programme such as for, while, do-while statements in some programming languages
like java, c++, c#, visual studio.....etc.
4. Algorithm for visiting each item on data programme or data function or data class in turn so
as to display it or perform some other action on these items.
5. Algorithm for sorting the data or Database normalization. There are many ways to sort data.
Simple sorting, Advanced sorting.
6. And other Algorithms that helps in other things that helps in structuring data with the help of
programme commands & the algorithms that governs and controls these programme
commands to help in shaping our data programme or application.

Definition of DSA: In computer science, a data structure & algorithms is a particular way of
storing and organizing data in a computer so that it can be used efficiently.

There are different types of DATA STRUCTURE followed by


application & operating systems. Different kinds of data structures are suited to
different kinds of applications, and some are highly specialized to specific tasks. For example, B-
trees (this designed for relationships in databases or relational databases) are particularly well-suited for
implementation of databases, while compiler implementations usually use hash tables(designed for
Operating Systems) to look up identifiers or controls or commands.

Data structures are used in almost every program or software system. Data
structures provide a means to manage huge amounts of data efficiently, such as large databases
and internet indexing services. Usually, efficient data structures are a key to designing efficient algorithms.
Some formal design methods and programming languages emphasize data structures, rather than
algorithms, as the key organizing factor in software design.

Very Important Note:


Different kinds of data structures are suited to different kinds of
applications softwares, operating systems, utility softwares because that software or
programme cannot achieve some thing unless it has process to follow (steps to follow) or to
work. So Data structures are used in almost every program or software system such as
computers, mobiles, calculators.........etc.

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE -5-


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

Basic principles of DSA:

Data structures are generally based on the ability of a computer to fetch and store data at any
place in its memory (main memory, secondary memory & register memory) , specified by an MEMORY
ADDRESS : a bit string that can be itself stored in memory and manipulated by the program.
Thus the record and array data structures are based on computing the addresses of data items with arithmetic
operations; while the linked data structures are based on storing addresses of data items within the structure
itself. Many data structures use both principles, sometimes combined in non-trivial ways.

The implementation of a data structure usually requires writing a set of procedures that
create and manipulate instances of that structure. The efficiency of a data structure cannot be analyzed
separately from those operations. This observation motivates the theoretical concept of an abstract data
type, a data structure that is defined indirectly by the operations that may be performed on it, and the
mathematical properties of those operations (including their space and time cost).

Data Structure is a systematic way to organize data in order to use it efficiently. Following terms are the
foundation terms of a data structure.

Interface Each data structure has an interface. Interface represents the set of operations
that a data structure supports. An interface only provides the list of supported operations,
type of parameters they can accept and return type of these operations.
Implementation Implementation provides the internal representation of a data structure.
Implementation also provides the definition of the algorithms used in the operations of the
data structure.

Characteristics of a Data Structure


Correctness Data structure implementation should implement its interface correctly.
Time Complexity Running time or the execution time of operations of data structure must
be as small as possible.
Space Complexity Memory usage of a data structure operation should be as little as
possible.

Need for Data Structure


As applications are getting complex and data rich, there are three common problems that applications
face now-a-days.


6
Data Search Consider an inventory of 1 million(10 ) items of a store. If the application is to
6
search an item, it has to search an item in 1 million(10 ) items every time slowing down the
search. As data grows, search will become slower.
Processor speed Processor speed although being very high, falls limited if the data grows
to billion records.
Multiple requests As thousands of users can search data simultaneously on a web server,
even the fast server fails while searching the data.

To solve the above-mentioned problems, data structures come to rescue. Data can be organized in a
data structure in such a way that all items may not be required to be searched, and the required data
can be searched almost instantly.

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE -6-


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

Execution Time Cases


There are three cases which are usually used to compare various data structure's execution
time in a relative manner.

Worst Case This is the scenario where a particular data structure operation takes
maximum time it can take. If an operation's worst case time is (n) then this operation will not
take more than (n) time where (n) represents function of n.
Average Case This is the scenario depicting the average execution time of an operation of
a data structure. If an operation takes (n) time in execution, then m operations will take
m(n) time.
Best Case This is the scenario depicting the least possible execution time of an operation
of a data structure. If an operation takes (n) time in execution, then the actual operation may
take time as the random number which would be maximum as (n).

Basic Terminology
Data Data are values or set of values.
Data Item Data item refers to single unit of values.
Group Items Data items that are divided into sub items are called as Group Items.
Elementary Items Data items that cannot be divided are called as Elementary Items.
Attribute and Entity An entity is that which contains certain attributes or properties, which
may be assigned values.
Entity Set Entities of similar attributes form an entity set.
Field Field is a single elementary unit of information representing an attribute of an entity.
Record Record is a collection of field values of a given entity.
File File is a collection of records of the entities in a given entity set.

Data Definition
Data Definition defines a particular data with the following characteristics.

Atomic Definition should define a single concept.


Traceable Definition should be able to be mapped to some data element or
searched.
Accurate Definition should be unambiguous.
Clear and Concise Definition should be understandable.

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE -7-


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

Data Object
Data Object represents an object having a data.

Data Type
Data type is a way to classify various types of data such as integer, string, etc. which
determines the values that can be used with the corresponding type of data, the type of
operations that can be performed on the corresponding type of data. There are two data types

Built-in Data Type


Derived Data Type

Built-in Data Type

Those data types for which a language has built-in support are known as Built-in Data types.
For example, most of the languages provide the following built-in data types.

Integers
Boolean (true, false)
Floating (Decimal numbers)
Character and Strings

Derived Data Type

Those data types which are implementation independent as they can be implemented in one
or the other way are known as derived data types. These data types are normally built by the
combination of primary or built-in data types and associated operations on them. For
example

List
Array
Stack
Queue

Basic Operations
The data in the data structures are processed by certain operations. The particular data
structure chosen largely depends on the frequency of the operation that needs to be
performed on the data structure. For Example

Traversing
Searching
Insertion
Deletion
Sorting
Merging

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE -8-


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

Basic types of Data Structures


As we discussed above, anything that can store data can be called as a data strucure, hence Integer,
Float, Boolean, Char etc, all are data structures. They are known as Primitive Data Structures.

Then we also have some complex Data Structures, which are used to store large and connected
data. Some example of Abstract Data Structure are :

Linked List
Tree
Graph
Stack, Queue etc.

An algorithm is said to be efficient and fast, if it takes less time to execute and consumes less
memory space.

The performance of an algorithm is measured on the basis of following properties:

1. Time Complexity
2. Space Complexity

Space Complexity:
Its the amount of memory space required by the algorithm, during the course of its execution.
Space complexity must be taken seriously for multi-user systems and in situations where
limited memory is available.

An algorithm generally requires space for following components:

Instruction Space: Its the space required to store the executable version of the
program. This space is fixed, but varies depending upon the number of lines of code
in the program.
Data Space: Its the space required to store all the constants and variables value.
Environment Space: Its the space required to store the environment information
needed to resume the suspended function.

Time Complexity
Time Complexity is a way to represent the amount of time needed by the program to run to
completion. We will study this in details in our section

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE -9-


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

Types of Data Structures:


1. Stack.
2. Queue.
3. Linked List.
4. Array.
5. Trees.

These are the techniques that is been used to manage the data in computer memory ( both main
memory & CPU memory).

Different computers use different data structures that have some not all the above characteristics.

Some computers use some of the a above techniques not all depending on the computer type that
is enabled to use certain data structure that uses some of the a above techniques.

IMPORTANT NOTES:

1. DIFFERENT DATA STRUCTURES ARE USED by the computer system depending on the
computer type & also depending on operating systems and applications that is been used on that
computer.
2. It is not necessary that the DATA STRUCTURE designed for a certain computer & a certain
application should have all the characters above so it can have some not all.
3. The DATA STRUCTURE is used to organize, manage & know the structure of data in the main
memory & CPU memory.
4. The data structure is been shaped up & setted (the computer is designed to use a specific data
structure model) for a computer during computer engineering phase.
5. Some of the goals of DATA STRUCTURE are:

The application ( or programming language) should be capable of handling their own


memory management (ask for a memory space without the interference of OS) when they
are at the run time (when they are running).
The applications should be capable of finding their own errors depending on the DATA
STRUCTURE followed by application like logical errors (division / 0, using wrong data
type).

DATA FLOW DIAGRAM:

Definition: A data flow diagram (DFD) is a graphical representation of the "flow" of data through
an information system & modeling its process aspects. Often they are a preliminary step used to create an overview
of the system which can later be elaborated. DFDs can also be used for the visualization of data processing (structured
design).

A DFD shows what kinds of data will be input to and output from the system, where the data will come from
and go to, and where the data will be stored. It does not show information about the timing of processes, or
information about whether processes will operate in sequence or in parallel (how it will operate).

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE - 10 -


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

How flow charts work:

The major symbols are the DECISION (also known as selection) and the SEQUENCE (or
process) symbols. The START and STOP symbols are called the terminals. The SUBPROCESS
symbol is a variation on the sequence symbol. There are also connectors drawn between the symbols and
you will see these they called the flow (arrow) used in the examples below. There is at least one other
sequence symbol which is used to represent input/output processes but it is unnecessary to use it
sometimes.

There are some important rules concerning the symbols and these rules apply also to other ways of
stating algorithms:

Processes have only one entry point and one exit point.
Decisions have only one entry point & two exits one TRUE exit point and one FALSE exit
point.

An example algorithm flow chart by using C++ source code:

Here we are going to use a flow chart that represents the data flow (information flow) that describes the
way the loop or Repeat loop source code works in any programming language.

1- for loop flow chart:

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE - 11 -


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

Corresponding source code in c++:

#include <iostream.h>
void main()
{
float i, b, sum=0;
cout<<" ENTER ANY 10 NUMBERS TO CALCULATE THEIR SUM or TOTAL"<<endl;
for(i=1;i<=10;i++)
{
cout<<" ENTER THE NUMBER ";
cin>>b;
sum=sum+b;
}
cout<<" THE SUM = "<<sum<<endl;
cout<<"THE PROGRAMME IS FINISHED";
}

An example algorithm flow chart by using C++ source code:

Here we are going to use a flow chart that represents the data flow (information flow) that describes the
way the loop or Repeat loop source code works in any programming language.

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE - 12 -


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

2- Do-while loop flow chart:

Corresponding source code in C++ :

#include <iostream.h>
void main()
{
float i=1, b, sum=0;
cout<<" ENTER ANY 10 NUMBERS TO CALCULATE THEIR SUM or TOTAL"<<endl;
do
{
cout<<" ENTER THE NUMBER ";
cin>>b;
sum=sum+b;
i++;
} while ( i<=10 ) ;
cout<<" THE SUM = "<<sum<<endl;
cout<<"THE PROGRAMME IS FINISHED";
}

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE - 13 -


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

An example algorithm flow chart by using another C++ source code:

Here we are going to use a flow chart that represents the data flow (information flow) that describes the
way the if-else or selection statements source code works in any programming language.

3- if-else flow chart:

Corresponding source code in C++ :

#include<iostream.h>
void main()
{
float a,b;
cout<<"ENTER THE NUMBERS TO FIND OUT THE GREATES NUMBER AMONG THEM"<<endl;
cout<<"enter the first number";
cin>>a;
cout<<"enter the second number";
cin>>b;
if(a>b)
{
cout<<a<<" the first number is the greatest number";
}
else if(b>a)
{
cout<<b<<" the second number is the greatest number";
}
}

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE - 14 -


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

DSA organizes the computer memory:

In computer science, a data structure & algorithms is a particular way of


storing and organizing data in a computer so that it can be used efficiently.

Different kinds of data structures are suited to different kinds of


applications used on some computers, and some are highly specialized to specific tasks that has
to be performed on data in computer memory.

So the types of computer memory can be as follows:

1. Main memory (RAM, memory).


2. Register memory (CPU memory).
3. Secondary memory ( HDD, DVD, FLOPPIES, EXTERNAL HDD.......etc).

The first two types of memory which are Main memory & Register memory are the
two locations where the DATA STRUCTURE performs the entire action on the DATA that has to be
processed or evaluated (operations take place). So the entire action takes place in RAM & CPU memories.

These two types of memory are both a highly volatile memory & they are a very fast
memory too in speed, here a block diagram that shows the detail:

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE - 15 -


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

There are different types of data types depending on the DATA STRUCTURE that a
certain (specific) programming language uses so they vary from one programming language to another
based on the type of DSA followed by it. So what data type is to be used & up to what size it can be is
handled and fixed during installation of data structure that has to be used. There are some data types
that can be found in only some programming languages not in all such as the currency data type & others.
So the general data types that are included in any programming language are as follows:

Data types in data structure are as follows:

1. Integer:

This is used to represent a number without decimal point and it can have up to 10 digits in
size. The integer number can be signed or unsigned.

2. Float ( precision):

This is used to represent a number with decimal point and it can have up to 5 digits after the
decimal point. The float or precision number can be signed or unsigned.

3. Double ( double precision):

This is used to represent a number with decimal point and it can have more than 5 digits after
the decimal point. The double or double precision number can be signed or unsigned.

4. String:

This is used to represent a text & it can have up to unlimited characters in size. The string data
type can be in both formats uppercases or lowercases.

5. Character (char):

This is used to represent a single character or letter & it can be only one character in size. The
character data type can be in both formats uppercases or lowercases.

6. Boolean:

This is used to represent any one of two values TRUE or FALSE & it can have ONE value size.

7. Other data types:

There are some data types that can be found in only some programming languages not in all
such as the currency, single, small date......etc data types.

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE - 16 -


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

The data structure is based on the operating system so the OS is the


main component that facilitates the data structure.
What is an Operating System?

Definition: A program that acts as an intermediary between a user of a computer and the computer
hardware.

The OS goals helps in STRUCTURING DATA & ALLOWS ALGORITHMS to


be applied on the data stored in a computer.

Operating system goals:

1. Execute user programs and allow the user to run the computer effectively.
2. Make the computer system convenient to use (make the pc controllable).
3. Controlling data inputs & outputs of a computer in an efficient manner.

The DSA follows the basic structure of a computer system so from that
platform there are different structures of data used in every component used of data.

Computer System Structure?

Computer system can be divided into four components:

1. Hardware provides basic computing resources:


CPU, memory, I/O devices
Operating system.
Other computer hardwares.
2. Application programs : define the ways in which the system resources are used to
solve the computing problems of the users
Word processors, compilers, web browsers, database systems, video
games, programming languages such as c++, java, visual studioetc.

3. Users: the user of computer.

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE - 17 -


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

A block diagram that shows the Computer System Structure is as follows:

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE - 18 -


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

It is very important to know that DSA:

Data structure allocates all data resources such as SECONDARY MEMORY (HDD ,CD &
DVD) based on an specific algorithms that is used by the computer.
Data structure helps in controlling programs because it:
Controls execution of programs by its algorithms to prevent errors and improper use of
the computer data.

Computer System Organization:

Computer system organizations are the basic parts of computer system & these
parts are showed in the block diagram.

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE - 19 -


ADMAS UNIVERSITY ICT Department
LEACUTERES: ABDIAZIZ QABILE HARGIESA-SOMALILAND
DATA STRUCTURE & ALGORITHMS

ADMAS UNIVERSITY - HARGIESA-SOMALILAND - LEACUTERER: ABDIAZIZ QABILE - 20 -

Você também pode gostar