ICOM 4035 – Data Structures Lecture 1 - Introduction Manuel Rodriguez Martinez Electrical and Computer Engineering University of Puerto Rico, Mayagüez.

Slides:



Advertisements
Similar presentations
Amy Hatfield Central High School
Advertisements

Sec 1-3 Concept: Use Midpoint and Distance Formulas
Looking inside classes Fields, Constructors & Methods Week 3.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 8 – File Structures.
ICOM 4035 – Data Structures Lecture 15 – Graph ADT
Written by: Dr. JJ Shepherd
ICOM 4035 – Data Structures Lecture 12 – Hashtables & Map ADT Manuel Rodriguez Martinez Electrical and Computer Engineering University of Puerto Rico,
ICOM 4035 – Data Structures Lecture 8 – Doubly Linked Lists Manuel Rodriguez Martinez Electrical and Computer Engineering University of Puerto Rico, Mayagüez.
Intro to Java Part II. Calling an Objects Methods Use qualified names to call the objects methods. To form – you append the method name to an object reference.
1 Classes Overview l Classes as Types l Declaring Instance Variables l Implementing Methods l Constructors l Accessor and Mutator Methods.
ECE122 L6: Problem Definition and Implementation February 15, 2007 ECE 122 Engineering Problem Solving with Java Lecture 6 Problem Definition and Implementation.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Introduction.
Objects & Object-Oriented Programming (OOP) CSC 1401: Introduction to Programming with Java Week 15 – Lecture 1 Wanda M. Kunkle.
Understanding class definitions – Part II –. Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling Main.
Understanding class definitions Looking inside classes.
Java Classes Introduction and Chapter 1 Slides by Steve Armstrong LeTourneau University Longview, TX  2007,  Prentice Hall.
ICOM 4035 – Data Structures Lecture 2 – ADT and Interfaces Manuel Rodriguez Martinez Electrical and Computer Engineering University of Puerto Rico, Mayagüez.
1-8 The Coordinate Plane SWBAT: Find the Distance between two points in the Coordinate Plane. Find the Coordinates of a Midpoint of a segment.
ICOM 4035 – Data Structures Lecture 9 – Stack ADT Manuel Rodriguez Martinez Electrical and Computer Engineering University of Puerto Rico, Mayagüez ©Manuel.
Object Oriented Programming Concepts OOP – reasoning about a program as a set of objects rather than as a set of actions Object – a programming entity.
ICOM 4035 – Data Structures Lecture 5 – List ADT Manuel Rodriguez Martinez Electrical and Computer Engineering University of Puerto Rico, Mayagüez ©Manuel.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
ICOM 4035 – Data Structures Lecture 6 – Big-O Notation Manuel Rodriguez Martinez Electrical and Computer Engineering University of Puerto Rico, Mayagüez.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
ICOM 4035 – Data Structures Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 6 – September 6 th, 2001.
ICOM 4035 – Data Structures Lecture 13 – Trees ADT Manuel Rodriguez Martinez Electrical and Computer Engineering University of Puerto Rico, Mayagüez ©Manuel.
CSCI-383 Object-Oriented Programming & Design Lecture 13.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 2 – Relational Model.
Classes CS 21a: Introduction to Computing I First Semester,
ICOM 4035 – Data Structures Lecture 14 – Binary Search Tree ADT Manuel Rodriguez Martinez Electrical and Computer Engineering University of Puerto Rico,
ICOM 4035 – Data Structures Lecture 11 – Map ADT Manuel Rodriguez Martinez Electrical and Computer Engineering University of Puerto Rico, Mayagüez ©Manuel.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com ICOM 5016 – Introduction.
ICOM 4035 – Data Structures Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 4 – August 30, 2001.
ICOM 4035 – Data Structures Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 9 – September 18, 2001.
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
ICOM 4035 – Data Structures Lecture 3 – Bag ADT Manuel Rodriguez Martinez Electrical and Computer Engineering University of Puerto Rico, Mayagüez ©Manuel.
ICOM 4035 – Data Structures Lecture 7 – Linked Lists Manuel Rodriguez Martinez Electrical and Computer Engineering University of Puerto Rico, Mayagüez.
Understanding class definitions
VECTORS (Ch. 12) Vectors in the plane Definition: A vector v in the Cartesian plane is an ordered pair of real numbers:  a,b . We write v =  a,b  and.
ICOM 4035 – Data Structures Lecture 10 – Queue ADT Manuel Rodriguez Martinez Electrical and Computer Engineering University of Puerto Rico, Mayagüez ©Manuel.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com ICOM 5016 – Introduction.
ICOM 4035 – Data Structures Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 10 – September 20, 2001.
ICOM 4035 – Data Structures Lecture 4 – Set ADT Manuel Rodriguez Martinez Electrical and Computer Engineering University of Puerto Rico, Mayagüez ©Manuel.
8.1 and 8.2 answers. 8.3: Vectors February 9, 2009.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com ICOM 5016 – Introduction.
ICOM 4035 – Data Structures Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 2 – August 23, 2001.
ICOM 4035 – Data Structures Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 5 – September 4 th, 2001.
YG - CS Concept of Encapsulation What is encapsulation? - data and functions/methods are packaged together in the class normally.
Java Classes Introduction. Contents Introduction Objects and Classes Using the Methods in a Java Class – References and Aliases Defining a Java Class.
Computer Graphics Mathematical Fundamentals Lecture 10 Taqdees A. Siddiqi
Computer Programming II Lecture 5. Introduction to Object Oriented Programming (OOP) - There are two common programming methods : procedural programming.
Programming in Java: lecture 7
Objects as a programming concept
Chapter 3: Using Methods, Classes, and Objects
Java Review: Reference Types
Understanding class definitions
1-6 Midpoint & Distance in the Coordinate Plane
Introduction to Abstract Data Types
Chapter 1: Lesson 1.1 Rectangular Coordinates
Understanding class definitions
ICOM 5016 – Introduction to Database Systems
Classes CS 21a: Introduction to Computing I
CS2013 Lecture 7 John Hurley Cal State LA.
Dr. R Z Khan Handout-3 Classes
ICOM 5016 – Introduction to Database Systems
Pythagorean Theorem.
CS 1054: Lecture 2, Chapter 1 Objects and Classes.
1-6: Midpoint and Distance
COS 151 Bootcamp – Week 4 Department of Computer Science
Presentation transcript:

ICOM 4035 – Data Structures Lecture 1 - Introduction Manuel Rodriguez Martinez Electrical and Computer Engineering University of Puerto Rico, Mayagüez ©Manuel Rodriguez – All rights reserved

Lecture Organization Part I – Introduction Part II – Vector Class Creation Part III – Vector Class Operators M. Rodriguez-MartinezICOM

Objectives Understand the terms abstract data types and data structures Describe the process that leads to – ADT design – Data structure implementation Provide motivating examples ICOM 4035M. Rodriguez-Martinez 3

Companion videos Lecture1 Videos – Contain the coding process associated with this lecture – Show how build the Java classes mentioned here M. Rodriguez-MartinezICOM

Abstract Data Types First Concept – Abstract Data Type (ADT) – Mathematical model of data to be represented Ingredients of ADT: – Values – data to be stored Represent the current state in the model – Operations – actions to be taken Modify the current state in the model Produce new information based on current values ICOM 4035M. Rodriguez-Martinez 5

Data Structure Second Concept – Data Structure – Implementation of ADT using constructs of a programming language Ingredients of Data Structure – Variables and data types – storage for ADT values – Methods – instructions to execute ADT operations ADT can be implemented with different types of data structures ICOM 4035M. Rodriguez-Martinez 6

Example: Vector ADT Consider a two dimensional vector – Coordinate vector in Cartesian plane – Origin is at (0,0) and end-point is at (x,y) – Represented as: or as or as: x y (0,0) (a,b) ICOM 4035M. Rodriguez-Martinez 7

Values in Vector ADT Given a vector v, we need to keep track of: – value of x coordinate – value of y coordinate – we know start point is at origin (0,0) Both x and y coordinate are real numbers In Java, we can represent these with the double data type – 64-bit floating point number ICOM 4035M. Rodriguez-Martinez 8

Operations in Vector ADT Creation – build a new vector at (a,b) Mutators– re-assign vector coordinates – We will not do this – vector will be immutable Good practice Accessors – inspects the values of coordinates Externalizer – convert to a string of characters Mathematical operations – Vector addition, subtraction, dot product, magnitude, etc. ICOM 4035M. Rodriguez-Martinez 9

Part II – Vector Class Creation M. Rodriguez-MartinezICOM

Vector Data Structure Use Java classes to implement the Vector ADT We can create a class named Vector Class has two fields to represent coordinates – Both are floating point values Class has a collection of public methods – Implement all operations Fields x y Methods Vector Class 4 3 Fields x y Methods Vector instance for v = (4,3) ICOM 4035M. Rodriguez-Martinez 11

Vector Operations – Creation & Accessors Creation – allocates memory to new instance of Vector – Done via constructor : Vector v = Vector (4.3, 4); Assessors – Inspect values in vector v – Getters in Java lingo – Inspect value of x coordinate v.getX(); – Inspect value of y coordinate v.getY(); M. Rodriguez-MartinezICOM

Part III - Vector Class Operators M. Rodriguez-MartinezICOM

Vector Magnitude Magnitude of the a vector – length of line segment Length of hypotenuse – Pythagorean Theorem – Value: M. Rodriguez-MartinezICOM x y (0,0) (a,b) a b magnitude

Vector Addition Given two vectors: Vector addition is defined as follows: Method call: – Vector v3 = v1.sum(v2); – v3 is new vector resulting from sum v1 + v2 M. Rodriguez-MartinezICOM

Vector Subtraction Given two vectors: Vector subtraction is defined as follows: Method call: – Vector v3 = v1.subtract(v2); – v3 is new vector resulting from sum v1 - v2 M. Rodriguez-MartinezICOM

Vector Inner (Dot) Product Given two vectors: Vector subtraction is defined as follows: Method call: – double n = v1.innerProduct(v2); – n is number resulting from v1  v2 M. Rodriguez-MartinezICOM

Summary Process to write code should be – 1. Work on defining ADT What data you need to represent? What operations must be supported? – 2. Pick a data structure to implement ADT Chose basic types or other data structures to store values Write member methods to implement operations – 3. Revise, test, revise, test, … M. Rodriguez-MartinezICOM

Questions? – ICOM 4035M. Rodriguez-Martinez 19