Intro. to Data Structures 1CSCI 3333 Data Structures - Roughly based on Chapter 6.

Slides:



Advertisements
Similar presentations
Slide: 1 Interra Induction Training Data Structure ADT & Complexity.
Advertisements

Fundamentals of Python: From First Programs Through Data Structures
PROGRAMMING LANGUAGE (JAVA) UNIT 42 BY ROBERT BUTTERFIELD TELEPHONE Data Structures and Algorithms.
Chapter 6.5, 17 Linked Lists 1CSCI 3333 Data Structures.
Fall 2002CMSC Discrete Structures1 If I told you once, it must be... Recursion.
Fall 2002CMSC Discrete Structures1 Follow me for a walk through... MathematicalInduction.
Data Structures.
Hashing / Hash tables Chapter 20 CSCI 3333 Data Structures.
Data Structures1 Basic Data Structures Elementary Structures Arrays Lists Search Structures Binary search Tree Hash Tables Sequence Structures Stacks Queues.
The Efficiency of Algorithms Chapter 4 Copyright ©2012 by Pearson Education, Inc. All rights reserved.
Advanced Data Structures
CSCE 210 Data Structures and Algorithms
CS 307 Fundamentals of Computer Science 1 Abstract Data Types many slides taken from Mike Scott, UT Austin.
1 Advanced Data Structures. 2 Topics Data structures (old) stack, list, array, BST (new) Trees, heaps, union-find, hash tables, spatial, string Algorithm.
Review for Test 2 i206 Fall 2010 John Chuang. 2 Topics  Operating System and Memory Hierarchy  Algorithm analysis and Big-O Notation  Data structures.
Rossella Lau Lecture 1, DCO20105, Semester A, DCO Data structures and algorithms  Lecture 1: Introduction What this course is about:  Data.
Basic Definitions Data Structures: Data Structures: A data structure is a systematic way of organizing and accessing data. Or, It’s the logical relationship.
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
The Design and Analysis of Algorithms
Rossella Lau Lecture 1, DCO20105, Semester A, DCO Data structures and algorithms  Lecture 1: Introduction What this course is about:  Data.
Introduction - The Need for Data Structures Data structures organize data –This gives more efficient programs. More powerful computers encourage more complex.
Data Structures and Programming.  John Edgar2.
Data Structures 1- Course Syllabus. 2- Introduction about Data Structures.
Analysis of Algorithm Lecture 3 Recurrence, control structure and few examples (Part 1) Huma Ayub (Assistant Professor) Department of Software Engineering.
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.
Lecture 10: Class Review Dr John Levine Algorithms and Complexity March 13th 2006.
Course Web Page Most information about the course (including the syllabus) will be posted on the course wiki:
IT 60101: Lecture #151 Foundation of Computing Systems Lecture 15 Searching Algorithms.
TECH Computer Science Dynamic Sets and Searching Analysis Technique  Amortized Analysis // average cost of each operation in the worst case Dynamic Sets.
General Data Structures and Algorithms CS 244 Brent M. Dingle, Ph.D. Department of Mathematics, Statistics, and Computer Science University of Wisconsin.
DATA STRUCTURE & ALGORITHMS (BCS 1223) NURUL HASLINDA NGAH SEMESTER /2014.
“Enthusiasm releases the drive to carry you over obstacles and adds significance to all you do.” – Norman Vincent Peale Thought for the Day.
Data Structures Using C++ 2E Chapter 9 Searching and Hashing Algorithms.
Can’t provide fast insertion/removal and fast lookup at the same time Vectors, Linked Lists, Stack, Queues, Deques 4 Data Structures - CSCI 102 Copyright.
Data Structure Introduction.
Data Structures Lecture 1: Introduction. Course Contents Data Types   Overview, Introductory concepts   Data Types, meaning and implementation  
Hashing Hashing is another method for sorting and searching data.
Data Structure & Algorithm
Data Abstaraction Chapter 10.
CHAPTER 8 SEARCHING CSEB324 DATA STRUCTURES & ALGORITHM.
Elementary Data Organization. Outline  Data, Entity and Information  Primitive data types  Non primitive data Types  Data structure  Definition 
1 5. Abstract Data Structures & Algorithms 5.1 Data Structure Fundamentals.
Hashtables. An Abstract data type that supports the following operations: –Insert –Find –Remove Search trees can be used for the same operations but require.
Data Structures Using C++ 2E Chapter 9 Searching and Hashing Algorithms.
Lecture 9COMPSCI.220.FS.T Lower Bound for Sorting Complexity Each algorithm that sorts by comparing only pairs of elements must use at least 
1. Searching The basic characteristics of any searching algorithm is that searching should be efficient, it should have less number of computations involved.
Introduction to Objects and Encapsulation Computer Science 4 Mr. Gerb Reference: Objective: Understand Encapsulation and abstract data types.
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)]
Prof. Amr Goneid, AUC1 CSCI 210 Data Structures and Algorithms Prof. Amr Goneid AUC Part 5. Dictionaries(2): Hash Tables.
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.
Introduction toData structures and Algorithms
CSCE 210 Data Structures and Algorithms
Sections 10.5 – 10.6 Hashing.
Planning & System installation
Data Structures Using C++ 2E
CSCI 210 Data Structures and Algorithms
Planning & System installation
Final Review.
Cinda Heeren / Geoffrey Tien
Searching.
structures and their relationships." - Linus Torvalds
What to do when you don’t know anything know nothing
Data Structures: Introductory lecture
Introduction to Data Structure
Data Structures Using C++ 2E
structures and their relationships." - Linus Torvalds
Presentation transcript:

Intro. to Data Structures 1CSCI 3333 Data Structures - Roughly based on Chapter 6

What? A data structure is a representation of data and the operations allowed on that data. An object in OOP? ADT (abstract data type): a data structure that is defined indirectly by the operations that may be performed on it, and the mathematical properties of those operations. Example data structures: – Arrays – Stacks – Queues – Linked lists – Trees – Graphs – … CSCI 3333 Data Structures2 Q: What do we have without data structures?

Why? Data structures provide various abstractions (structures and operations) and can therefore be used for computer applications that benefit from such abstractions. A data structure is used along with algorithms to achieve efficiency. Good performance (aka. efficiency) of a computer application depends on well-designed data structures and their related algorithms. For example: exhaustive search vs binary search on arrays CSCI 3333 Data Structures3

When do we use a data structure? Whenever its use is justified in a program, usually depending on the requirements and constraints. CSCI 3333 Data Structures4 Where do we use a data structure?

How are data structures supported in a programming languages ? As built-in features of the language – Arrays are supported by most high-level languages – Linked lists in some – Hash tables (or associated arrays) in some – Records – ADTs – Classes in OOP As features defined in libraries or packages CSCI 3333 Data Structures5

How do we learn to use data structures? Understand the fundamental features of various data structures – the structure, the operations Learn how to evaluate the efficiency of a data structure and related algorithms. Evaluate different implementations of the same data structure for their respective performance. Apply the learned knowledge in programming projects. Practice! Practice! CSCI 3333 Data Structures6

Common operations in a data structure CSCI 3333 Data Structures7

8 An example StringArrayList Dynamic array expansion Q: data? Q: operations ? Q: anything missing ?

The iterator pattern A common technique used in accessing an aggregate object such as arrays e.g., printing all items in array v for (int i=0; i < v.length; i++) { System.out.println ( v[i] ); } Exercises: Assuming v is an integer array, define the following as a method. a)Add all the items in v and return the sum. b)Reverse the values in v. c)Expand the capacity of v by doubling it. CSCI 3333 Data Structures9

The static search problem (Sec. 5.6) Given an integer X and an array A, return the position of X in A or an indication that it is not present. If X occurs more than once, return any occurrence. The array A is never altered. Many applications: looking up a person, a book, a product, … Different solutions (algorithms) exist. – Sequential search – Binary search – … CSCI 3333 Data Structures10

Evaluation of different algorithms For each of the algorithms: – Any prerequisites? – Cost of unsuccessful search – Worst case scenario for successful search – Best case scenario for successful search – Average case scenario Contexts of comparison? – Elapsed time only (assuming the whole array is in memory) – Memory use? – Disk access? – Network latency? CSCI 3333 Data Structures11