170 likes | 321 Views
DEPARTMENT OF TECHNICAL EDUCATION ANDHRA PRADESH. Name :S V Kumar Designation :Head of Section Branch : Computer Engineering Institute : Government Polytechnic, Hyderabad Year/Semester : III-Semester Subject : Data structure through ‘C’
E N D
DEPARTMENT OF TECHNICAL EDUCATION ANDHRA PRADESH Name :S V Kumar Designation :Head of Section Branch : Computer Engineering Institute : Government Polytechnic, Hyderabad Year/Semester : III-SemesterSubject : Data structure through ‘C’ Subject Code : 9CM305Topic : Introduction to Data Structure Duration of Period : 50 min Sub. Topic : Introduction –Abstract data types Teaching Aids to be used :Animation Clips & Images Revised by : Bapuji naik 9CM305.3
Objectives -What are abstract data types? -Why it is called abstract? -Where we use ADT? -Why it is used? On completion of this period, you would be able to know 9CM305.3
Recap In the last class , we have learnt • What are data structures? • Classification of data structures -Linear data structures -Non linear data structures 9CM305.3
Recap (cont..) • Linear Data Structures -Arrays -Stacks -Queues -Linked Lists • Non Linear Data Structures -Trees -Graphs 9CM305.3
The term ‘Abstract’ Abstract data types • Means very brief about something called outlining • Birds’ Eye View from the sky - abstract view • Satellite pictures - Abstract form of some happenings • Abstract Data Type is abbreviated as ADT 9CM305.3
Abstract data types Problem Prepare a model of the solution called ADT Choose suitable Data Structure and Programming Language for ADT Create Program (solution) 9CM305.3
Abstract data types ADT is expressed in terms of • Data – Affected with your problem • Operations – Identified in a way to solution 9CM305.3
Abstract data types (cont..) 1. Declaration of data 2. Declaration of operations 9CM305.3
Contd… Abstract data types • Consider a list • There are at least four data structures that support list • an array • a linked list • a tree • or a net work • If we place list in an ADT • As long as we can insert and retrieve data , it should make no different how we store the data 9CM305.3
A stack ADT for list Contd… Abstract data types • stack (item ) • Operations Create() stack Add(item , stack) stack Delete(stack) stack Top(stack) item ISempty (stack) boolean 9CM305.3
Contd… Abstract data types • The above ADT , defines a stack • It is defined in a pseudo code (not a specific programming language ) format • The variable stack is a list structure used to implement stack ADT • The variable ‘item’ represents the elements of the stack • eg :- a number like integer • The different possible operations on stack are declared • If the user wants to implement this stack ADT, • He has to write code for declarations as well as operations in any programming language 9CM305.3
Why ADT? • To abstract means to ignore some details of a thing in favor of others. • Abstraction is important in problem solving because it allows problem solvers to focus on essential details. • It ignores the inessential, thus simplifying the problem and bringing to the attention of important aspects involved in its solution. 9CM305.3
Why ADT? Abstract data types are important in computer science because • it provides a clear and precise way to specify what data a program must manipulate • how the program must manipulate its data • without much about how data are represented or how operations are implemented • Once an abstract data type is understood and documented, it serves as a specification that programmers can use to guide their choice of data representation and operation implementation, and as a standard for ensuring program correctness. 9CM305.3
Summary • In this lesson, we have learnt What is abstract ?– very brief about something Where an ADT comes in the program development? What are the main aspects an ADT covers? – Data, Operations A model for representing an ADT An example for ADT-stack 9CM305.3
QUIZ • Which of the following statement is true about abstract data type • It makes implementation details visible • It hides implementation • ADT contains only data declaration • ADT contains only operation declarations. 9CM305.3
Frequently asked question 1)What is an ADT? 2) Write about ADT with an example. 9CM305.3
Assignment Prepare an ADT for the almirah 9CM305.3