CHAPTER 3 COLLECTIONS Abstract Data Types. 2 A data type consists of a set of values or elements, called its domain, and a set of operators acting on.

Slides:



Advertisements
Similar presentations
ITEC200 Week04 Lists and the Collection Interface.
Advertisements

Data Structures.
Data Structures A data structure is a collection of data organized in some fashion that permits access to individual elements stored in the structure This.
Computer Science 112 Fundamentals of Programming II Overview of Collections.
Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
©Brooks/Cole, 2003 Chapter 12 Abstract Data Type.
Data Structures & Algorithms
CS 307 Fundamentals of Computer Science 1 Abstract Data Types many slides taken from Mike Scott, UT Austin.
Chapter 3 Collections. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 3-2 Chapter Objectives Define the concept and terminology related.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
CHAPTER 3 COLLECTIONS SET Collection. 2 Abstract Data Types A data type consists of a set of values or elements, called its domain, and a set of operators.
Basic Definitions Data Structures: Data Structures: A data structure is a systematic way of organizing and accessing data. Or, It’s the logical relationship.
Chapter 12 Collections. © 2004 Pearson Addison-Wesley. All rights reserved12-2 Collections A collection is an object that helps us organize and manage.
Chapter 8 Lists. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 8-2 Chapter Objectives Examine list processing and various ordering techniques.
Basic Concepts Chapter 1 Objectives
© 2004 Pearson Addison-Wesley. All rights reserved12-1 Chapter 12 : Collections Intermediate Java Programming Summer 2007.
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.
Abstract Data Types (ADTs) and data structures: terminology and definitions A type is a collection of values. For example, the boolean type consists of.
Chapter 3 Introduction to Collections – Stacks Modified
Chapter 3 List Stacks and Queues. Data Structures Data structure is a representation of data and the operations allowed on that data. Data structure is.
Data Structures and Abstract Data Types "Get your data structures correct first, and the rest of the program will write itself." - David Jones.
Lists Based on content from: Java Foundations, 3rd Edition.
Chapter 8 Lists. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.1-2 Chapter Objectives Examine list processing and various ordering techniques.
Chapter 3 Functions Functions provide a means of expressing relationships between variables, which can be numbers or non-numerical objects.
Computer Science Department Data Structures and Algorithms Lecture 1.
 DATA STRUCTURE DATA STRUCTURE  DATA STRUCTURE OPERATIONS DATA STRUCTURE OPERATIONS  BIG-O NOTATION BIG-O NOTATION  TYPES OF DATA STRUCTURE TYPES.
CSS446 Spring 2014 Nan Wang  Java Collection Framework ◦ LinkedList ◦ Set ◦ Map 2.
Chapter 12: Collections by Lewis and Loftus (Updated by Dan Fleck) Coming up: Collections.
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
1 Chapter 2 The Big Picture. 2 Overview ● The big picture answers to several questions.  What are data structures?  What data structures do we study?
Data Abstaraction Chapter 10.
Views of Data Data – nouns of programming world the objects that are manipulated information that is processed Humans like to group information Classes,
Chapter 2 Collections. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.1-2 Chapter Objectives Define the concept and terminology related.
Chapter 3 Collections. Objectives  Define the concepts and terminology related to collections  Explore the basic structures of the Java Collections.
Chapter 12 Abstract Data Type. Understand the concept of an abstract data type (ADT). Understand the concept of a linear list as well as its operations.
Data Design and Implementation. Definitions Atomic or primitive type A data type whose elements are single, non-decomposable data items Composite type.
(1) ICS 313: Programming Language Theory Chapter 11: Abstract Data Types (Data Abstraction)
2 Obaid Ullah HOD Computer Science Dept. Superior University Sialkot Campus.
Topic 2 Collections. 2-2 Objectives Define the concepts and terminology related to collections Discuss the abstract design of collections.
Introduction to Objects and Encapsulation Computer Science 4 Mr. Gerb Reference: Objective: Understand Encapsulation and abstract data types.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 18 List ADT Animated Version.
Collections Using Generics in Collections. 2 Chapter Objectives Define the concept and terminology related to collections Explore the basic structure.
CSC 205 Java Programming II Abstract Data Type. Abstraction The meaning of abstraction Abstraction arises from a recognition of similarities between certain.
CPS120: Introduction to Computer Science Nell Dale John Lewis Abstract Data Types.
CSE 373, Copyright S. Tanimoto, 2002 Abstract Data Types - 1 Abstract Data Types Motivation Abstract Data Types Example Using math. functions to describe.
Code: BCA302 Data Structures with C Prof.(Dr.) Monalisa Banerjee By.
9/27/2016IT 1791 Abstraction A tool (concept) to manage complexity Hide irrelevant details; focus on the features needed Primitive date types are already.
Data Abstraction and Problem Solving with JAVA Walls and Mirrors Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Data Abstraction and Problem.
Sections 3.4 Formal Specification
The List ADT.
12 Collections Software Solutions Lewis & Loftus java 5TH EDITION
Fundamentals of Programming II Overview of Collections
Abstraction A tool (concept) to manage complexity
Data Structures Data Structure is a way of collecting and organising data in such a way that we can perform operations on these data in an effective.
The Object Oriented Approach to Design
Data Structures and Database Applications Abstract Data Types
Introduction to Data Structure
structures and their relationships." - Linus Torvalds
Abstract Data Types (ADTs)
structures and their relationships." - Linus Torvalds
Chapter 12 Collections.
Introduction to Computer Science for Majors II
Chapter 2 The Big Picture.
Introduction to Data Structure
Chapter 12 Collections.
Lecture 11 Abstract Data Type
Chapter 4 Review.
structures and their relationships." - Linus Torvalds
A type is a collection of values
Presentation transcript:

CHAPTER 3 COLLECTIONS Abstract Data Types

2 A data type consists of a set of values or elements, called its domain, and a set of operators acting on that domain. Abstract Data Type: A set of data values and associated operations that are precisely specified independent of any particular implementation

3 ADT specification ADT specification is language independent. It consists of specifying the data values and the operations

4 ADT design and implementation Based on encapsulation : The user of the ADT should not be concerned with how the values are represented, and how the operations are implemented The user should be concerned only with how to create and use objects of a particular ADT ADT interface description

5 Interfaces The interface to an ADT tells the user how to use the ADT The interface says what the allowed operations are. The interface says nothing about how the operations are implemented. The class that implements the interface provides the bodies of the methods

6 Collections A collection is an object that gathers and organizes other objects (elements). Some fundamental collections are: stack, queue, list, tree, graph, etc. Collections can be broadly categorized as linear (organizes the elements in a straight line) or nonlinear

7

8 Element Organization The elements within a collection are usually organized based on: the order in which they were added to a collection, some inherent relationship among the elements themselves

9 Collections as ADTs Define the collection conceptually as a set of values and a set of operations Define the interface to the ADT Design and implement the corresponding Java class that will contain the data representation and will implement the interface

10 Basic operations for collections add and remove elements determine if the collection is empty determine the collection's size iterators, to process each element in the collection operations that interact with other collections

11 Issues How does the collection operate conceptually? How do we formally define its interface? What kinds of problems does it help us solve? What ways might we implement it? What are the benefits and costs of each implementation?