Abstract Data Types, Elementary Data Structures and Arrays

Slides:



Advertisements
Similar presentations
EC-211 DATA STRUCTURES LECTURE 2. EXISTING DATA STRUCTURES IN C/C++ ARRAYS – A 1-D array is a finite, ordered set of homogeneous elements – E.g. int a[100]
Advertisements

COMP102 – Programming Fundamentals I LA2B (Mon 5-7pm) LA2E (Fri 3-5pm) LA2F (Fri 5-7pm) TA: Jackie Lo.
ISBN Chapter 6 Data Types: Structured types.
Basic Definitions Data Structures: Data Structures: A data structure is a systematic way of organizing and accessing data. Or, It’s the logical relationship.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Data Structures.
Chapter 3 Data Structures and Abstract Data Type Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Lecture DS & Algorithms:09 Abstract Data Types. Lecture DS & Algorithms:09 2 Abstract Data Types Data Type: A data type is a collection of values and.
Introduction to Arrays in Java Corresponds with Chapter 6 of textbook.
COMP102 Lab 081 COMP 102 Programming Fundamentals I Presented by : Timture Choi.
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
Computer Programming 12 Mr. Jean April 24, The plan: Video clip of the day Upcoming Quiz Sample arrays Using arrays More about arrays.
Data Structures and Algorithms Lecture 3 Instructor: Quratulain Date: 8 th September, 2009.
Chapter 8: Arrays and Functions Department of Computer Science Foundation Year Program Umm Alqura University, Makkah Computer Programming Skills
Data Structures Lecture 1: Introduction. Course Contents Data Types   Overview, Introductory concepts   Data Types, meaning and implementation  
UniMAP Sem2-10/11 DKT121: Fundamental of Computer Programming1 Arrays.
EGR 115 Introduction to Computing for Engineers MATLAB Basics 1: Variables & Arrays Wednesday 03 Sept 2014 EGR 115 Introduction to Computing for Engineers.
COMPUTER PROGRAMMING. Array C++ provides a data structure, the array, which stores a fixed-size sequential collection of elements of the same type. An.
Data Structure and Algorithm: CIT231 Lecture 3: Arrays and ADT DeSiaMore DeSiaMorewww.desiamore.com/ifm1.
REEM ALMOTIRI Information Technology Department Majmaah University.
C++ Array 1. C++ provides a data structure, the array, which stores a fixed-size sequential collection of elements of the same type. An array is used.
Multi-dimensional Array 1 Multi-dimensional array refers to an array with more than one index. It is a logical representation. On physical storage, the.
Arrays. C++ Style Data Structures: Arrays(1) An ordered set (sequence) with a fixed number of elements, all of the same type, where the basic operation.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Lecture.
Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Third Edition by Tony Gaddis.
KUKUM-06/07 EKT120: Computer Programming 1 Week 6 Arrays-Part 1.
Windows Programming Lecture 03. Pointers and Arrays.
C Programming Lecture 15 Two Dimensional Arrays. Two-Dimensional Arrays b The C language allows arrays of any type, including arrays of arrays. With two.
UNIT-V ABSTRACT DATA TYPE 1.LIST 2.STACK 3.QUEUE EC6301-II-ECE-C.
Advanced Data Structures Lecture 1
Introduction toData structures and Algorithms
Two-Dimensional Arrays
September 29 – Stacks and queues
COMP 53 – Week Eleven Hashtables.
Computer Programming BCT 1113
Two Dimensional Array Mr. Jacobs.
EKT120 : Computer Programming
EGR 115 Introduction to Computing for Engineers
Lecture 7 – Arrays (1) PGT 106 : C PROGRAMMING.
Data Structures and Abstract Data Types
structures and their relationships." - Linus Torvalds
Abstract Data Types (ADTs)
Two Dimensional Arrays
Arrays An Array is an ordered collection of variables
structures and their relationships." - Linus Torvalds
2D Arrays October 12, 2007 ComS 207: Programming I (in Java)
Further Data Structures
EKT150 : Computer Programming
Declaration, assignment & accessing
Data Structures: Introductory lecture
Introduction To Programming Information Technology , 1’st Semester
EKT120: Computer Programming
Multidimensional Arrays
Starting Out with Programming Logic & Design
Data Types and Data Structures
Multidimensional array
Managing Collections of Data
Introduction to Data Structure
Dr Tripty Singh Arrays.
Arrays Arrays A few types Structures of related data items
Multi-Dimensional Arrays
CS149D Elements of Computer Science
Dynamic allocation (continued)
C++ Array 1.
Arrays Imran Rashid CTO at ManiWeber Technologies.
Programming Fundamental
Arrays and Matrices Prof. Abdul Hameed.
Arrays Prepared By Paritosh Srivastava PGT (CS) KV NHPC Banbasa.
structures and their relationships." - Linus Torvalds
A type is a collection of values
Abstract Data Types (ADTs)
Presentation transcript:

Abstract Data Types, Elementary Data Structures and Arrays Lecture 01 Abstract Data Types, Elementary Data Structures and Arrays

Abstract data Types Abstract Data Type is an organized collection of information and a set of operations used to manage that information. e.g. Whole numbers (integers) and arithmetic operators for addition, subtraction, multiplication and division. e.g. Flight reservation Basic operations: find empty seat, reserve a seat, cancel a seat assignment Data, operations, and relations are studied independent of implementation. What not how is the focus. Superior Uni- DSA2014 BSSE

ADT and DS A data structure is the physical implementation of an ADT. Abstract data type a new type describes properties and operations Each ADT operation is defined by its inputs and outputs Collection of elements or we can say information. Logical form A data structure is the physical implementation of an ADT. Each operation associated with the ADT is implemented by one or more subroutines in the implementation. How collection is stored in memory Physical/ Concrete form Stack is ADT with push, pop operations, but can we say about stack data structure if I mean I used stack implemented as an array in my algorithm? And why heap isn't ADT Superior Uni- DSA2014 BSSE

Data Type ADT: Type Data Items: Operations Logical Form Data Structure: Storage Space Subroutines Data Items: Physical Form 4 Superior Uni- DSA2014 BSSE

Arrays An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier The lowest address corresponds to the first element and the highest address to the last element. One dimensional array Two Dimensional array Superior Uni- DSA2014 BSSE

type arrayName [ arraySize ]; double balance[10]; Declaring Arrays: type arrayName [ arraySize ]; double balance[10]; Initializing array double balance[5] = {1000.0, 2.0, 3.4, 17.0, 50.0}; Accessing Array Elements: double salary = balance[9]; Superior Uni- DSA2014 BSSE

Superior Uni- DSA2014 BSSE

Superior Uni- DSA2014 BSSE

Superior Uni- DSA2014 BSSE

2D array Simplest form of multidimensional array A two-dimensional array can be think as a table, which will have x number of rows and y number of columns Most high level languages support arrays with more than one dimension. 2D arrays are useful when data has to be arranged in tabular form. Higher dimensional arrays appropriate when several characteristics associated with data. Superior Uni- DSA2014 BSSE

Declaring 2D Array type arrayName [ x ][ y ]; Initializing 2D Array: int a[3][4] = { {0, 1, 2, 3} , {4, 5, 6, 7} , {8, 9, 10, 11} }; or int a[3][4] = {0,1,2,3,4,5,6,7,8,9,10,11}; Accessing Two-Dimensional Array Elements: int val = a[2][3]; Superior Uni- DSA2014 BSSE

Superior Uni- DSA2014 BSSE