1 CS 350 Data Structures Chaminade University of Honolulu.

Slides:



Advertisements
Similar presentations
PROGRAMMING LANGUAGE (JAVA) UNIT 42 BY ROBERT BUTTERFIELD TELEPHONE Data Structures and Algorithms.
Advertisements

CSE 1302 Lecture 23 Hashing and Hash Tables Richard Gesick.
Data Structures.
Overview of Data Structures and Algorithms
COMPSCI 105 S Principles of Computer Science 12 Abstract Data Type.
©Silberschatz, Korth and Sudarshan12.1Database System Concepts Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B+-Tree Index Files B-Tree.
COEN 352 Data structures and Algorithms R. Dssouli.
BTrees & Bitmap Indexes
Abstract Data Types (ADT)
Introduction to Databases Transparencies
© 2006 Pearson Addison-Wesley. All rights reserved13 B-1 Chapter 13 (excerpts) Advanced Implementation of Tables CS102 Sections 51 and 52 Marc Smith and.
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
Chapter 8 Physical Database Design. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Overview of Physical Database.
Cmpt-225 Simulation. Application: Simulation Simulation  A technique for modeling the behavior of both natural and human-made systems  Goal Generate.
Coursenotes CS3114: Data Structures and Algorithms Clifford A. Shaffer Yang Cao Department of Computer Science Virginia Tech Copyright ©
Introduction - The Need for Data Structures Data structures organize data –This gives more efficient programs. More powerful computers encourage more complex.
1 A Introduction to Data Structures and Algorithm Analysis Data Structures Asst. Professor Kiran Soni.
DATA STRUCTURE Subject Code -14B11CI211.
Data Structures 1- Course Syllabus. 2- Introduction about Data Structures.
Data Structures Lecture-1:Introduction
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.
Copyright © Wondershare Software Introduction to Data Structures Prepared by: Eng. Ahmed & Mohamed Taha.
Lecture No.01 Data Structures Dr. Sohail Aslam
ITEC 2620A Introduction to Data Structures
Computer Science Department Data Structures and Algorithms Lecture 1.
Dr. Engr. Sami ur Rahman Assistant Professor Department of Computer Science University of Malakand Data Structure: Introduction.
Instructor Information: Dr. Radwa El Shawi Room: Week # 1: Overview & Review.
DATA STRUCTURES (CS212D) Week # 1: Overview & Review.
CS212: DATA STRUCTURES Lecture 1: Introduction. What is this course is about ?  Data structures : conceptual and concrete ways to organize data for efficient.
1 CSC 222: Computer Programming II Spring 2004 See online syllabus at: Course goals:
Chapter 17 Creating a Database.
Course notes CS2606: Data Structures and Object-Oriented Development Ryan Richardson John Paul Vergara Department of Computer Science Virginia Tech Spring.
Chapter 1 Data Structures and Algorithms. Primary Goals Present commonly used data structures Present commonly used data structures Introduce the idea.
Data Structures and Algorithms Lecture 1 Instructor: Quratulain Date: 1 st Sep, 2009.
Data Structure Introduction.
New Mexico Computer Science For All Algorithm Analysis Maureen Psaila-Dombrowski.
Data Structures Lecture 1: Introduction. Course Contents Data Types   Overview, Introductory concepts   Data Types, meaning and implementation  
Algorithm Analysis CS 400/600 – Data Structures. Algorithm Analysis2 Abstract Data Types Abstract Data Type (ADT): a definition for a data type solely.
Lecture 11 Data Structures, Algorithms & Complexity Introduction Dr Kevin Casey BSc, MSc, PhD GRIFFITH COLLEGE DUBLIN.
CS 127 Introduction to Computer Science. What is a computer?  “A machine that stores and manipulates information under the control of a changeable program”
Database Management Systems (DBMS)
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
Elementary Data Organization. Outline  Data, Entity and Information  Primitive data types  Non primitive data Types  Data structure  Definition 
Chapter 15 A External Methods. © 2004 Pearson Addison-Wesley. All rights reserved 15 A-2 A Look At External Storage External storage –Exists beyond the.
1 CS 311 Data Structures. 2 Instructor Name : Vana Doufexi Office : 2-229, Ford Building Office hours: By appointment.
Chapter 8 Physical Database Design. Outline Overview of Physical Database Design Inputs of Physical Database Design File Structures Query Optimization.
DATA STRUCTURES (CS212D) Overview & Review Instructor Information 2  Instructor Information:  Dr. Radwa El Shawi  Room: 
Topic 2 Collections. 2-2 Objectives Define the concepts and terminology related to collections Discuss the abstract design of collections.
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
1 A Practical Introduction to Data Structures and Algorithm Analysis Chaminade University of Honolulu Department of Computer Science Text by Clifford Shaffer.
© 2006 Pearson Addison-Wesley. All rights reserved15 A-1 Chapter 15 External Methods.
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture1.
CSC 143T 1 CSC 143 Highlights of Tables and Hashing [Chapter 11 p (Tables)] [Chapter 12 p (Hashing)]
Introduction: Databases and Database Systems Lecture # 1 June 19,2012 National University of Computer and Emerging Sciences.
南昌大学自动化系胡凌燕 1 Charpter 1 The data structures and algorithms (p3) There are often many approaches to solving a problem. How do we choose between them? 
FALL 2005CENG 213 Data Structures1 Review. FALL 2005CENG 213 Data Structures2 Collection of items Problems that must manage data by value. Some important.
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.
Mohammed I DAABO COURSE CODE: CSC 355 COURSE TITLE: Data Structures.
Advanced Data Structures Lecture 1
Introduction toData structures and Algorithms
Record Storage, File Organization, and Indexes
What is “Data Structures”?
Introduction to Computer Programming
Algorithm An algorithm is a finite set of steps required to solve a problem. An algorithm must have following properties: Input: An algorithm must have.
Data Structures: Introductory lecture
Week # 1: Overview & Review
Introduction to Data Structures
Introduction to Data Structure
Database management systems
Presentation transcript:

1 CS 350 Data Structures Chaminade University of Honolulu

2 Introduction Why Data Structures? What Is Data Structure? Program Efficiency Example: Banking Application Example: City Database Abstract Data Type

3 Why Data Structures? Main function of computers is to perform calculations—fast, and efficiently. Complex jobs require intensive calculations How do you make computers work efficiently? Hardware Software Software solution Algorithms Algorithms depend on data structures

4 What Is a Data Structure? In a general sense, any data representation is a data structure. E.g., integer, string Specifically, data structure is an organization for a collection of data items. You choose appropriate data structure for efficient processing of data.

5 Data Structure and Algorithm Different data structures can be used for processing data—searching, sorting, modifying, etc. But the choice of data structure, and accompanying algorithm can make the difference between a fast program (sec, min) and a long program (hrs, days).

6 Program Efficiency A program is said to be efficient if it solves a problem without wasting computing resources of: Space Time The cost of a (program) solution is the amount of resources that the solution consumes.

7 Example: Banking Application Typical Operations Open accounts (far less often than access) Close accounts (far less often than access) Access account to Add money Access account to Withdraw money

8 Banking Application (cont.) Teller and ATM transactions are expected to take short time (minutes). Opening or closing an account can take longer time (perhaps up to an hour).

9 Banking Application (cont.) Kind of data structure for this application: Must be highly efficient for search of account May be less efficient for deletion of account May be moderately efficient for insertion of account

10 Banking Application (cont.) Hash Table Meets these requirements Allow for extremely fast records search. Also supports efficient insertion of new records. Deletions can also be supported efficiently. (But too many deletions lead to performance degradation–requiring the hash table to be reorganized.)

11 Example: City Database Database system for city information Search by particular value--e.g., ZIP code, street name, building name-- (exact match) Search by range of values--e.g., population, income level—(range query)

12 City Database (cont.) The database must answer queries quickly For an exact-match query, fast operation (seconds) For a range queries, the entire operation may be allowed to take longer (minutes)

13 City Database (cont.) The hash table is inappropriate because it cannot perform efficient range queries The B+ tree supports large databases for: Insertion Deletion Range queries If the database is created once and then never changed, simple linear lists may be more appropriate.

14 Selecting a Data Structure Selection Criteria for a Data Structure 1. Analyze the problem to determine the resource constraints a solution must meet. 2. Determine the basic operations that must be supported. Quantify the resource constraints for each operation. 3. Select the data structure that best meets these requirements.

15 Data Structure Philosophy Each problem has constraints on available space and time. Only after a careful analysis of problem characteristics can we know the best data structure for the task. Bank example: Start account: a few minutes Transactions: a few seconds Close account: overnight

16 Goals of this Course  Reinforce the concept that costs and benefits exist for every data structure  Choice of data structure is important for complex processing  Learn commonly used data structures  Programmer's basic data structure “toolkit”  Understand how to measure the cost of a data structure or program.  Algorithm analysis

17 Abstract Data Type Abstract Data Type (ADT): specification for a data type solely in terms of a set of values a set of operations on that data type

18 Abstract Data Type (cont.) Humans handle complexity in hierarchy of abstraction E.g., dog  runs, barks, eats dog  runs with legs barks with lungs, mouth eats with mouth, stomac E.g., list  insert item, remove item, search list  data in array insert item into array remove item by overwriting use binary search algorith

19 Abstract Data Type (cont.) ADT provides a set of (high-level) operations as an interface to the outside world Data Structure and algorithm provides the (low-level) implementation of the abstract operations

20 Abstract Data Type (cont) Information Hiding Principle of hiding the design and implementation details of data structure Encapsulation Way to achieve information hidng. Often used synonymously with information hiding itself.

21 ADT and Data Structure Data Structure the physical implementation of an ADT. Each operation in the ADT is implemented by one or more subroutines in the implementation. In a OO language, an ADT and its implementation together make up a class. Data Structure: usually refers to an organization for data in main memory. File Structure: an organization for data on external storage, such as a disk drive.

22 Data Type ADT: Type Operations Data Items: Logical Form Data Items: Physical Form Data Structure: Storage Space Subroutines

23 Programs A computer program is a concrete representation of an algorithm in some programming language. Naturally, there are many programs that are instances of the same algorithms, since any modern programming language can be used to implement any algorithm.

24 To Summarize: A problem is a function or a mapping of inputs to outputs. An algorithm is a recipe for solving a problem whose steps are concrete and ambiguous. A program is an instantiation of an algorithm in a computer programming language.

25 Your Turn Imagine that you are a shipping clerk for a large company. You have just been handed about 1000 invoices, each of which is a single sheet of paper with a unique large number in the upper right corner. The invoices must be sorted by this number, in order from lowest to highest. Write down as many different approaches to sorting the invoices as you can think of. You can recruit your friend to help you.