Data Structures Goal: organize data Criteria: facilitate efficient

Slides:



Advertisements
Similar presentations
Programming Paradigms and languages
Advertisements

Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
Chapter Four Data Types Pratt 2 Data Objects A run-time grouping of one or more pieces of data in a virtual machine a container for data it can be –system.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Introduction.
G. Levine Chapter 6 Chapter 6 Encapsulation –Why do we want encapsulation? Programmer friendliness- programmer need not know about these details –Easier.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Introduction.
Elementary Data Types Scalar Data Types Numerical Data Types Other
Structured Data Types and Encapsulation Mechanisms to create new data types: –Structured data Homogeneous: arrays, lists, sets, Non-homogeneous: records.
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.
Data Structures and Algorithms Course’s slides: Introduction, Basic data types
CS 171: Introduction to Computer Science II Stacks Ymir Vigfusson.
MT311 Java Application Programming and Programming Languages Li Tak Sing ( 李德成 )
1 Chapter-01 Programming Methodologies Procedural/Structured Design Objected-Oriented Design.
Lec 6 Data types. Variable: Its data object that is defined and named by the programmer explicitly in a program. Data Types: It’s a class of Dos together.
1 Intro to Data Structures and ADTs Chapter 2. 2 Goal of Data Structures Organize data Facilitate efficient … –storage –retrieval –manipulation Select.
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Ch. 5 Ch. 51 jcmt CSE 3302 Programming Languages CSE3302 Programming Languages (more notes) Dr. Carter Tiernan.
1 Programming Paradigms Object Orientated Programming Paradigm (OOP)
Types(1). Lecture 52 Type(1)  A type is a collection of values and operations on those values. Integer type  values..., -2, -1, 0, 1, 2,...  operations.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved More about.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
Pascal Programming Arrays and String Type.
1 OOP - An Introduction ISQS 6337 John R. Durrett.
(1) ICS 313: Programming Language Theory Chapter 12: Object Oriented Programming.
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Ch. 5 Ch. 51 jcmt Summer 2003Programming Languages CSE3302 Programming Languages (more notes) Summer 2003 Dr. Carter Tiernan.
Copyright 2006 Oxford Consulting, Ltd1 January Introduction to C++ Programming is taking A problem Find the area of a rectangle A set of data.
MT311 Java Application Development and Programming Languages Li Tak Sing ( 李德成 )
1 CSE Programming in C++. 2 Overview Sign roster list Syllabus and Course Policies Introduction to C++ About Lab 1 Fill Questionnaire.
 Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. 
Data Structure and Algorithm: CIT231 Lecture 3: Arrays and ADT DeSiaMore DeSiaMorewww.desiamore.com/ifm1.
Chapter 2 Principles of Programming and Software Engineering.
Arrays Declaring arrays Passing arrays to functions Searching arrays with linear search Sorting arrays with insertion sort Multidimensional arrays Programming.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved More about.
Prof. I. J. Chung Data Structure #1 Professor I. J. Chung.
Maitrayee Mukerji. INPUT MEMORY PROCESS OUTPUT DATA INFO.
Lecture 1 Data Structures Aamir Zia. Introduction Course outline Rules and regulations Course contents Good Programming Practices Data Types and Data.
Floating Point Numbers
Floating Point Representations
Advanced Data Structures Lecture 1
Computers’ Basic Organization
Chapter 9 Subprograms.
Pascal Programming Arrays and String Type.
Data Types In Text: Chapter 6.
Chapter 6 – Data Types CSCE 343.
Type Checking Generalizes the concept of operands and operators to include subprograms and assignments Type checking is the activity of ensuring that the.
Computer Programming BCT 1113
Chapter 6: Data Types Lectures # 10.
GC211Data Structure Lecture2 Sara Alhajjam.
CS 326 Programming Languages, Concepts and Implementation
Data Abstraction & Problem Solving with C++
More about OOP and ADTs Classes
Data Structures and Abstract Data Types
CSCI 3370: Principles of Programming Languages Chapter 9 Subprograms
.NET and .NET Core 5.2 Type Operations Pan Wuming 2016.
Object Based Programming
Chapter 10 Thinking in Objects
Introduction to Abstract Data Types
More about OOP and ADTs Classes
Collections Not in our text.
Introduction to Data Structure
Intro to Data Structures and ADTs
Java Programming Language
Programming Languages and Paradigms
Data Structures and ADTs
Arrays.
Presentation transcript:

Data Structures Goal: organize data Criteria: facilitate efficient storage of data retrieval of data manipulation of data Process: select and design appropriate data types

Examples

Tradeoff

abstract data type (ADT)

implementation of an ADT

Simple Data Types (§2.2)

Boolean data

Character Data

Integer Data

Sign-magnitude representation

Two's complement representation

Biased representation

Problems with Integer Representation Limited Capacity -- a finite number of bits Overflow - addition or multiplication can exceed largest value permitted by storage scheme Underflow - subtraction or multiplication can exceed smallest value permitted by storage scheme Not a perfect representation of (mathematical) integers can only store a finite (sub)range of them

Real Data

Problems with Real Representation

C-Style One-Dimensional Arrays (§2.3)

Declaring arrays in C++

Subscript operator

Array Initialization

Initializations with no array size specified

Addresses

C-Style Multidimensional Arrays

Problems with C-Style Arrays Capacity cannot change. No predefined operations on non-char arrays. ® Must perform bounds checking, size restrictions, ... C-style arrays aren't self-contained. ® Must pass size (and/or capacity) to array-processing functions. Solution (OOP): Encapsulate array, capacity, size, and operations in a class. ® vector

A commercial for OOP: Two programming paradigms Object-oriented: ( C++, Java, and Smalltalk) Focuses on the nouns of a problem's specification Programmers: Determine what objects are needed for a problem and how they should work together to solve the problem. Create types called classes made up ofdata members and function members to operate on the data. Instances of a type (class) are called objects. Procedural: ( C, FORTRAN, and Pascal ) Action-oriented — concentrates on the verbs of a problem's specification Programmers: Identify basic tasks to be performed to solve problem Implement the actions required to do these tasks as subprograms (procedures/functions/subroutines) Group these subprograms into programs/modules/libraries, which together make up a complete system for solving the problem