0% found this document useful (0 votes)
52 views

Data Structures and Algorithms: Eng. Malek Al-Louzi

This document provides an introduction to data structures and algorithms. It defines data structures as fundamental building blocks in computer science that are used to organize and store data efficiently. Examples are given of how different data structure choices, like sorted lists versus unsorted lists, can impact efficiency when solving problems like dictionary lookups or representing maps. Common data structures like lists, trees, graphs and hashes are introduced. The document also defines an algorithm as a set of systematic instructions to solve a given problem using operations on data structures. Overall, the introduction emphasizes how both data structures and algorithms are important concepts to understand for designing efficient software systems.

Uploaded by

SARA ALABAHRAA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

Data Structures and Algorithms: Eng. Malek Al-Louzi

This document provides an introduction to data structures and algorithms. It defines data structures as fundamental building blocks in computer science that are used to organize and store data efficiently. Examples are given of how different data structure choices, like sorted lists versus unsorted lists, can impact efficiency when solving problems like dictionary lookups or representing maps. Common data structures like lists, trees, graphs and hashes are introduced. The document also defines an algorithm as a set of systematic instructions to solve a given problem using operations on data structures. Overall, the introduction emphasizes how both data structures and algorithms are important concepts to understand for designing efficient software systems.

Uploaded by

SARA ALABAHRAA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Data Structures and Algorithms

Introduction

Prepared by:
Eng. Malek Al-Louzi
School of Computing and Informatics – Al Hussein Technical University

Spring 2021/2022
Outlines
Introduction.

What are Data Structures?

Abstract Data Type.

Data Structures.

Algorithms.

Page 2
Introduction
Data Structures are the most fundamental and building block in
Computer Science.

Good knowledge of Data Structures is a must to design and develop


efficient Software systems.

We deal with Data all the time, and how we store, organize and
group our data together matters.

Page 3
To pick some examples, where
organizing data in a particular
structure helps us.

Page 4
Example 1: Dictionary

We can search a word meaning quickly and efficiently in a dictionary,


because the words are sorted.

Dictionary is organized as a sorted list of words.

What if the words were not sorted?

Page 5
Example 2: Neighborhood Map (1/6)
If you want to make a system for your neighborhood
like google maps:

Page 6
Example 2: Neighborhood Map (2/6)

If you already have each place coordinates:

Page 7
Example 2: Neighborhood Map (3/6)

Now, you can tell where each location is exactly, but you can't tell
how these locations are connected with streets.

We need to figure out a way to store these information in computer.

There are different options to store these information.

Page 8
Example 2: Neighborhood Map (4/6)
Option 1: Store all possible paths in a list format.

Page 9
Example 2: Neighborhood Map (5/6)

Option 2: list each of the places, and for each place list all places that
you can go from that place.

Page 10
Example 2: Neighborhood Map (6/6)
These two options are basically two different ways of storing the same
set of data but using different structures.
In general, different kind of structures are needed to store different kind
of data.
Computers are work with different kind of data: text, images, videos,
…etc.
If we don’t use the right kind of structures, then our software will not be
efficient.

Page 11
Definition,
Types and What are Data Structures?
Explanation

Page 12
Definition of Data Structures
The formal definition of Data structure is:

Page 13
Representation Ways of Data Structures
We will study data structures in two ways:
1. Mathematical and Logical models (Abstract Data Types):
We will just look at abstract view of them.
From high level view, what are features and operations define a particular
data structure.
2. Implementation.
We can impalement the same ADT in multiple ways in the same
programming language.

Page 14
Abstract Data Type (1/2)
Abstract view of a device named Television:

An electrical device that can turn ON and OFF.

Receive signals from satellite.

Show these signals as Audio and Video.

We are not bothered how circuits are embedded to create


that device, or which company makes this device.

Page 15
Abstract Data Type (2/2)
Formal definition of Abstract Data Type (ADT):

We will learn about a lot of data structures as ADT, also how we
implement them.

Page 16
Abstract Data Type: Basic List (1/2)
We want to define something called a List:

Page 17
Abstract Data Type: Basic List (2/2)
If you notice, all High-Level languages already have a concrete
implementation of this List ADT in the form of Arrays.
Arrays give us all these functionality .
We can implement the same ADT in multiple ways in the same
language.
List ADT can be implemented also as a data structure called Linked
List.

Page 18
Data Structures (1/2)
Data structures that we will learn in this class:

Page 19
Data Structures (2/2)
We will learn the following for each data structure:
Logical view.
Operations.
Cost of operations.
Implementation.

Page 20
Our Course is Data Structures & Algorithms
So
We need to know
Example 3: Shortest Path to School (1/4)
We want to find the shortest path from home to school.

Page 22
Example 3: Shortest Path to School (2/4)
Solving this problem by hand is easy.
We can see there are three potential paths from home to school.

Page 23
Example 3: Shortest Path to School (3/4)
For theses three paths, compare the distance that you need to travel
and pick the shortest one.
To compute the distance, you can use the coordinates (Longitude
and Latitude) and find the distance in Kilometers.
Solving problem by hand is easy, but if we want to turn this to
something a computer can understand, you need to be more
systematic.

Page 24
Example 3: Shortest Path to School (4/4)

You can come up with a set of instructions that a computer can


understand.

Page 25
Algorithms
So basically, you have a problem you want to solve.
For solving the problem, you will have a set of systematic
instructions.
Note that, depending on a what data structure you are using to store
the data that you are performing the Algorithm on, your algorithm
might be different.
So, Algorithm is: The operations that we can perform on different
data structures, and the set of instructions for executing them to
solve a given problem.

Page 26
Any Questions???

Page 27

You might also like