Data Structure Dr. Mohamed Khafagy. Abstraction.Abstraction is a technique in which we construct a model of an entity based upon its essential Characteristics.

Slides:



Advertisements
Similar presentations
Object Oriented Programming
Advertisements

Lecture 6 Sept 11, 2008 Goals for the day: Linked list and project # 1 list class in STL (section 3.3) stack – implementation and applications.
Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
Chapter 10 THINKING IN OBJECTS 1 Object Oriented programming Instructor: Dr. Essam H. Houssein.
EEM 480 Algorithms and Complexity by Assist. Prof. Dr. Emin Germen.
Design The goal is to design a modular solution, using the techniques of: Decomposition Abstraction Encapsulation In Object Oriented Programming this is.
Department of Computer Science University of Maryland, College Park
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Basic Concepts Chapter 1 Objectives
C++ fundamentals.
Introduction - The Need for Data Structures Data structures organize data –This gives more efficient programs. More powerful computers encourage more complex.
Data Structures 1- Course Syllabus. 2- Introduction about Data Structures.
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Title: Overview of Data Structure.
Comp 245 Data Structures Software Engineering. What is Software Engineering? Most students obtain the problem and immediately start coding the solution.
Data Structure (Part I) Chapter 2 – Arrays Data Abstraction and Encapsulation in C++ Section 1.3 –Data Encapsulation Also called information hiding.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
Data Abstraction CS 201j: Engineering Software University of Virginia Computer Science Nathanael Paul
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Data Structures and Algorithms Lecture # 1 Book: Fundamentals of Data Structures in c++ Horwitz, Sahani, and Mehta.
Computer Science Department Data Structures and Algorithms Lecture 1.
Chapter 10 Strings, Searches, Sorts, and Modifications Midterm Review By Ben Razon AP Computer Science Period 3.
Prepared By Ms.R.K.Dharme Head Computer Department.
1 CSC 222: Computer Programming II Spring 2004 See online syllabus at: Course goals:
1 CS 350 Data Structures Chaminade University of Honolulu.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
OBJECT-ORIENTED PROGRAMMING (OOP) WITH C++ Instructor: Dr. Hany H. Ammar Dept. of Electrical and Computer Engineering, WVU.
Data Structures and Algorithms Lecture 3 Instructor: Quratulain Date: 8 th September, 2009.
Chapter 1 Data Structures and Algorithms. Primary Goals Present commonly used data structures Present commonly used data structures Introduce the idea.
Design.ppt1 Top-down designs: 1. Define the Problem IPO 2. Identify tasks, Modularize 3. Use structure chart 4. Pseudocode for Mainline 5. Construct pseudocode.
Data Structure Introduction.
Data Structures Lecture 1: Introduction. Course Contents Data Types   Overview, Introductory concepts   Data Types, meaning and implementation  
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Data Abstaraction Chapter 10.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Abstraction ADTs, Information Hiding and Encapsulation.
Views of Data Data – nouns of programming world the objects that are manipulated information that is processed Humans like to group information Classes,
Introduction to Classes and Objects. Real Life When a design engineer needs an electrical motor he doesn’t need to worry about –How a foundry will cast.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
08 Encapsulation and Abstraction. 2 Contents Defining Abstraction Levels of Abstraction Class as Abstraction Defining a Java Class Instantiating a Class.
Data Structures Using C++ 2E
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
WELCOME to III SEM Date: Class - ECE no of present : no of absent :
Chapter 3 Collections. Objectives  Define the concepts and terminology related to collections  Explore the basic structures of the Java Collections.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
2 Obaid Ullah HOD Computer Science Dept. Superior University Sialkot Campus.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Object Oriented Programming. OOP  The fundamental idea behind object-oriented programming is:  The real world consists of objects. Computer programs.
Chapter 2 Principles of Programming and Software Engineering.
Data Structure and Algorithms
Principles of Programming. Achieving an Object-Oriented Design  Abstraction and Information Hiding  Object-Oriented Design  Functional Decomposition.
1 CS 132 Spring 2008 Chapter 1 Software Engineering Principles and C++ Classes.
Prof. I. J. Chung Data Structure #1 Professor I. J. Chung.
Maitrayee Mukerji. INPUT MEMORY PROCESS OUTPUT DATA INFO.
Introduction To Algorithm and Data Structures Course Teacher: Moona Kanwal -Algorithm Design -Algorithm Analysis -Data structures -Abstract Data Type.
 The Object Oriented concepts was evolved for solving complex problems. Object- oriented software development started in the 1980s. Object-oriented design.
Advanced Data Structures Lecture 1
Principles of Programming & Software Engineering
CompSci 280 S Introduction to Software Development
About the Presentations
Lecture 2 of Computer Science II
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
Abstract Data Types and Encapsulation Concepts
CS148 Introduction to Programming II
Algorithm An algorithm is a finite set of steps required to solve a problem. An algorithm must have following properties: Input: An algorithm must have.
Software Engineering Lecture #9.
FUNCTIONS WITH DEFAULT ARGUMENTS
Producing Production Quality Software
Introduction to Data Structure
Oriented Design and Abstract Data Type
Presentation transcript:

Data Structure Dr. Mohamed Khafagy

Abstraction.Abstraction is a technique in which we construct a model of an entity based upon its essential Characteristics while ignoring the inessential details..The principle of abstraction also helps in handling the inherent complexity of a system by allowing looking at its important external characteristic, and hiding its inner complexity at the same time..Hiding the internal details is called encapsulation..Engineers of all fields, including computer science, have been practicing abstraction for mastering complexity.

Types of data Abstraction.Code and Data abstraction ◦ What is Data ? - What is code ?

Advantages of data Abstraction Simplification of software development Testing and Debugging Reusability Modification to representation of a data type etc

void selectionSort(int a[],int size) { int I,j,min,temp; for(i=0; i<size-1; i++) { min=i; for(j=i; i<size; j++) { if(a[j]< a[min]) min=j; } temp=a[i]; a[i]=a[min]; a[min]=temp; } }

int minimum(int a[],int from,int to) { int min=from; for(int i=from;i<=to;i++) if(a[i] < a[min]) min=i; return min; } void selectionSort(int a[],int size) { int i,j,min; for(i=0;i<size-1;i++){ min=minimum(a,I,size-1) swap(a[i],a[min]); } void swap(int &x, int &y) { int temp=x; x=y; y=temp; }

Data Abstraction and Abstract Data Types(ADT) A data type is a template for objects and a set of operations that define the behavior of the objects (or instances) of that type. An Abstract data type (ADT) is a data type in which the implementation details are hidden and the user is concerned with the properties ( or behavior ) of that type. An ADT has two commponents: - Interface – the behavior - Implementation Example: -int,float

Abstract Data Type The data structures used to implement the data type can only be accessed through the interface. Any change in the implementation does not change the user programs as long as the interface remains the same. This is also known as data encapsulation or data abstraction. implementation interface1interfece2 interface3interface4

Abstraction Vs. Implementation X -> X = ? If x is CString -then x -> “ABC” If x is integer - then x ->

Abstraction Vs. Implementation Two dimensional array User’s view (abstraction) System’s view (implementation)

ADTs and C++ Classes A class is used to define (and implement) an ADT in C++. A class consists of data and functions that operate on that data. A class in C++ has two parts – public and private (let’s ignore the protected members for now). The data and functions defined in the class are called the members of the class.

ADTs and C++ Classes Users of the class can only access and manipulate the class state through the public members of the class. Private members can only be used by other members of the class (let’s also ignore the friends for now). Data encapsulation is achieved by declaring all data members of a class to be private. The interface of the class is provided through the use of public member functions.

Data Structures The primary objective of programming is to efficiently process the input to generate the desired output. We can achieve this objective in an efficient and neat style if the input data is organized in a way to help us meet our goal. Data Structures is nothing but ways and means of organizing data so that it can be processed easily and efficiently. Data structures dictate the manner in which the data can be processed. In other words, the choice of an algorithm depends upon the underlying data organization. ( What is an Algorithm ? )

Data Structure Operations Traversing Searching Inserting Deleting Sorting Merging Recursion To perform operations on various data structures we use algorithms.

Types of Data Structures Premitive/Scalar : data types that can be manipulated as a single quantity or can be represented alone Structured/ Non-Premitive (Data type which is collection of other premitive or non-premitive data structures. ◦ Can be further divided into a) linear b) non-linear - Linear can be further split into a) physically linear b) logically linear