0% found this document useful (0 votes)
21 views15 pages

DASTRU - Introduction

Uploaded by

OP Joyboy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views15 pages

DASTRU - Introduction

Uploaded by

OP Joyboy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Introduction To Data

Structures And
Algorithms
DASTRU Lesson 1

ACT - College of Computer Studies


DATA STRUCTURES
• it dictates the types of operations we can
perform on the data and how efficiently they
can be carried out
• defined as a collection of related data and a
set of rules for organizing and accessing it
• means of data organization and storage in a
computer so that these data can be used
efficiently
• are used in almost every program or
software system

ACT - College of Computer Studies


• A procedure for solving a problem in terms
of the actions to be executed, and the order
in which these actions are to be executed is
called algorithm.
• In computer science, an algorithm is an
effective method for solving a problem
expressed as a finite sequence of
instructions. Algorithms are used for
calculation, data processing and software
development.
• Moreover, algorithms are represented
graphically by flowcharts.
ACT - College of Computer Studies
Relationship between Data
Structures and the Algorithms

According to Niklaus
Wirth:

Algorithms + Data
ACT - College of Computer Studies
ALGORITHM
An algorithm is a concise specification of a
method for solving a problem.
A data structure can be viewed as consisting
of a set of algorithms for performing
operations on the data it stores.
Thus, algorithms are part of what constitutes a
data structure – that makes up a program as
a whole.

ACT - College of Computer Studies


Purpose of Algorithm
Data may be arranged and managed at many levels,
and the variability in algorithm design generally arises
in the manner in which the data for the program are
stored, that is:
(1) how data are arranged in relation to each other,
(2) which data are calculated as needed,
(3) which data are kept in memory, and
(4) which data are kept in files, and the arrangement of
the files.
An algorithm may need to put new data into an existing
collection of data, remove data from a collection, or
query a collection of data for a specific purpose.

ACT - College of Computer Studies


COLLECTIONS
A collection is a structured data type that
stores data and provides operations for
adding data to the collection, removing data
from the collection, updating data in the
collection, as well as operations for setting
and returning the values of different
attributes of the collection.
Collections can be broken down into two types:
linear and nonlinear.

ACT - College of Computer Studies


LINEAR COLLECTION
A linear collection is a list of elements where
one element follows the previous element.
Elements in a linear collection are normally
ordered by position (first, second, third, etc.).

ACT - College of Computer Studies


NON-LINEAR COLLECTION
Nonlinear collections hold elements that do not
have positional order within the collection.

ACT - College of Computer Studies


Collection Property
An example of a collection property is the
collections Count, which holds the number
of items in the collection.

ACT - College of Computer Studies


Collection Operations
Collection operations, called methods, include:
ADD (for adding a new element to a collection)
INSERT (for adding a new element to a collection at
a specified index)
REMOVE (for removing a specified element from a
collection)
CLEAR (for removing all the elements from a
collection)
CONTAINS (for determining if a specified element is
a member of a collection), and
IndexOf (for determining the index of a specified
element in a collection)
ACT - College of Computer Studies
Let’s wrap it!

ACT - College of Computer Studies


What is Data Structures?
What is Algorithm?
What is the formula to make a program
according to Niklaus Wirth?
What is a Collection?

ACT - College of Computer Studies


stion
a que
ha ve
o you n?
D ss o
he le
o utt
ab

ACT - College of Computer Studies


Introduction To Data
Structures And
Algorithms
DASTRU Lesson 1

ACT - College of Computer Studies

You might also like