CSEC1 Algorithms and Data Structures 1 - PowerPoint PPT Presentation

About This Presentation
Title:

CSEC1 Algorithms and Data Structures 1

Description:

CSE-C1 Algs & DS 1. CSE C1. Algorithms and. Data Structures 1. lecturer Dr.Matthew Montebello ... Definiteness: Each instruction must be clear and unambiguous. ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 13
Provided by: mmo89
Category:

less

Transcript and Presenter's Notes

Title: CSEC1 Algorithms and Data Structures 1


1
CSEC1Algorithms and Data Structures 1
  • lecturer Dr.Matthew Montebello
  • office CB 409
  • e-mail mmont_at_cs.um.edu.mt
  • credit 1
  • lectures 10
  • assignment 1 (50)
  • test 1 (50)
  • webpage
  • http//staff.um.edu.mt/mmon1/lectures/dip_cs_edu

2
Lecture Schedule
  • 1. Introduction to CSE-C1.
  • 2. Abstract Data Types (ADTs)
  • 3. Lists.
  • 4. Stacks.
  • 5. Queues.
  • 6. Deques.
  • 7. Trees.
  • 8. Sets.
  • 9. Past Papers other Queries.
  • 10. Closure Pre-Test Revision.

3
Introduction to CSE-C1
  • What will happen during lectures.
  • Practice makes perfect.
  • Web pages of interest
  • http//pascal.about.com/compute/
    pascal/library/weekly/aa011901.htm
  • http//taoyue.com/tutorials/pascal
  • http//www.cs.virginia.edu/mab8e/
    structures.html
  • http//allserv.rug.ac.be/vfack/files/
    algori.html
  • Use of Compiler.
  • Other procedures.

4
2. Abstract Data Types
  • Todays lecture
  • Overview of schedule
  • Recall of last lecture
  • General introd. to DS Algs.
  • DS in everyday life
  • Introduction to ADTs
  • Overview of ADTs covered
  • Normal processes of an ADT
  • Closure Summary
  • Next Lecture
  • Questions.

5
General Introd. to DS Algs
  • A Data Structure is an Abstract Data Type that
    has three following components
  • Operations Specifications of external appearance
    of a data structure
  • Storage Structures Organizations of data
    implemented in lower level data structures
  • Algorithms Description on how to manipulate
    information in the storage structures to obtain
    the results defined for the operations

6
General Introd. to DS Algs
  • An algorithm is a finite set of instructions
    chosen from a finite, fixed set of instructions.
  • Every algorithm must satisfy the following
    criteria.
  • Input It has zero or more input parameters.
  • Output It produces at least one output
    parameter.
  • Definiteness Each instruction must be clear and
    unambiguous.
  • Finiteness For every input, it executes only a
    finite number of instructions.
  • Effectiveness Every instruction must be
    sufficiently basic so that a machine can execute
    the instruction.

7
DS in Everyday Life
  • We use DS in the normal things we do during the
    day, like
  • Shopping list
  • List of Shores
  • Telephone directory
  • Same thing with algorithms, we implicitly define
    our own set of instructions on how we manipulate
    these daily DS, like
  • Add/removing items
  • Prioritizing items
  • Data to enter with each item

8
Introduction to ADTs
  • Definition of Abstract Data Type
  • Class of data objects (i.e., instances of the
    data type) with a set of the operations that can
    be applied to the objects (telling what to do
    instead of how to do)
  • ADT is specified by
  • a set of operations which can be applied to the
    objects and
  • a set of properties (called axioms) which all the
    objects and operations must satisfy.

9
Introduction to ADTs
  • Advantage of Abstract Data Type
  • Modularity (Encapsulation) The definition of
    operations isolates implementation of ADT from
    construction of a program using ADT.
  • Cohesiveness (Self-maintaining) Implementation of
    ADT can be changed without modifying programs
    using ADT.
  • Data Abstraction (minimal Coupling) The ADT does
    not depend on other processes during input or
    output.

10
Introduction to ADTs
  • Simple example of ADT
  • Name of ADT Integer
  • Operations that it will perform
  • CreateDefines an identifier with an undefined
    value
  • AssignAssigns the value of one integer
    identifier or value to another integer identifier
  • IsEqualreturns true if the values (or values
    associated with identifiers) of the two integers
    are the same
  • LessThanreturns true if the value of the first
    integer is less than the value of the second
    integer
  • Negativereturns the negative of the integer
    value
  • Sumreturns the sum of two integer values

11
Overview of ADTs covered
  • As already discussed and as seen in the schedule
    we will be covering in some detail the following
    DS based on the concept of ADT
  • Lists.
  • Stacks.
  • Queues.
  • Deques.
  • Trees.
  • Sets.
  • Tables

12
Normal Process of an ADT
  • The standard operations that we will be doing
    with each of the DS we will be covering will be
    explained in theory and programmed in the Pascal
    language.
  • Operations include
  • Define
  • Create
  • Add to
  • Remove from
  • Search
  • Empty
  • Check if full
  • Check if empty
  • Destroy
Write a Comment
User Comments (0)
About PowerShow.com