Data Structures IS 101Y/CMSC 101 Computational Thinking and Design Thursday, October 3, 2013 Marie desJardins University of Maryland, Baltimore County.

Slides:



Advertisements
Similar presentations
Simulation and Modeling: Predator-Prey Processing Lab IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, October 1, 2013 Marie desJardins University.
Advertisements

Every edge is in a red ellipse (the bags). The bags are connected in a tree. The bags an original vertex is part of are connected.
Abstract Data Types and Subprograms
Abstract Data Types and Subprograms
Graphs Graphs are the most general data structures we will study in this course. A graph is a more general version of connected nodes than the tree. Both.
Advanced Data Structures
SEARCHING, SORTING, TOPOLOGICAL SORTS Most real world computer applications deal with vast amounts of data. Searching for a particular data item can take.
Faculty of Sciences and Social Sciences HOPE Structured Problem Solving Week 12: Data Structures 1 Stewart Blakeway FML 213
Fall 2007CS 2251 Trees Chapter 8. Fall 2007CS 2252 Chapter Objectives To learn how to use a tree to represent a hierarchical organization of information.
CS 104 Introduction to Computer Science and Graphics Problems Data Structure & Algorithms (4) Data Structures 11/18/2008 Yang Song.
©Brooks/Cole, 2003 Chapter 12 Abstract Data Type.
Unit 11a 1 Unit 11: Data Structures & Complexity H We discuss in this unit Graphs and trees Binary search trees Hashing functions Recursive sorting: quicksort,
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Exercise Session 10.
COMP 110 Introduction to Programming Mr. Joshua Stough.
CISC220 Fall 2009 James Atlas Nov 13: Graphs, Line Intersections.
Recursion Chapter 7. Chapter 7: Recursion2 Chapter Objectives To understand how to think recursively To learn how to trace a recursive method To learn.
Important Problem Types and Fundamental Data Structures
Data Structures Lecture-1:Introduction
Introduction to Data Structures. Data Structures A data structure is a scheme for organizing data in the memory of a computer. Some of the more commonly.
Trees & Graphs Nell Dale & John Lewis (adaptation by Michael Goldwasser and Erin Chambers)
People: Usability IS 101Y/CMSC 101Y November 5, 2013 Marie desJardins Amanda Mancuso University of Maryland Baltimore County.
1 GRAPHS - ADVANCED APPLICATIONS Minimim Spanning Trees Shortest Path Transitive Closure.
B-trees (Balanced Trees) A B-tree is a special kind of tree, similar to a binary tree. However, It is not a binary search tree. It is not a binary tree.
Chapter 12 Data Structure Associate Prof. Yuh-Shyan Chen Dept. of Computer Science and Information Engineering National Chung-Cheng University.
Chapter 9 Abstract Data Types and Algorithms. 2 Abstract Data Types Abstract data type A data type whose properties (data and operations) are specified.
Introduction to Data Structures. About the document. The document is prepared by Prof. Shannon Bradshaw at Drew University. The key concepts in data structure.
Trees. Tree Terminology Chapter 8: Trees 2 A tree consists of a collection of elements or nodes, with each node linked to its successors The node at the.
1 Data Structures Lists and Trees. 2 Real-Life Computational Problems All about organizing data! –What shape the data should have to solve your problem.
Introduction to Data Structures. Definition Data structure is representation of the logical relationship existing between individual elements of data.
Design and Analysis of Algorithms CSC201 Shahid Hussain 1.
Chapters 7, 8, & 9 Quiz 3 Review 1. 2 Algorithms Algorithm A set of unambiguous instructions for solving a problem or subproblem in a finite amount of.
Computer Science Department Data Structures and Algorithms Lecture 1.
Trees Chapter 8. Chapter 8: Trees2 Chapter Objectives To learn how to use a tree to represent a hierarchical organization of information To learn how.
Spring 2010CS 2251 Trees Chapter 6. Spring 2010CS 2252 Chapter Objectives Learn to use a tree to represent a hierarchical organization of information.
Chapter 9 (modified) Abstract Data Types and Algorithms Nell Dale John Lewis.
9-1 Abstract Data Types Abstract data type A data type whose properties (data and operations) are specified independently of any particular implementation.
Discrete Structures Lecture 12: Trees Ji Yanyan United International College Thanks to Professor Michael Hvidsten.
PR Quadtree Geographical Data Structure. Background The structure of a BST is determined by the order of the data Depending on the order we can get either.
Symbol Tables and Search Trees CSE 2320 – Algorithms and Data Structures Vassilis Athitsos University of Texas at Arlington 1.
Lecture # 30 Data Organization and Binary Search.
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
Data Structures Types of Data Structure Data Structure Operations Examples Choosing Data Structures Data Structures in Alice.
Priority Queues and Heaps. October 2004John Edgar2  A queue should implement at least the first two of these operations:  insert – insert item at the.
Chapter 16 – Data Structures and Recursion. Data Structures u Built-in –Array –struct u User developed –linked list –stack –queue –tree Lesson 16.1.
M180: Data Structures & Algorithms in Java Trees & Binary Trees Arab Open University 1.
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
Data Structure and Algorithms
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture1.
Data Structures and Algorithms Lists, Stacks, Queues, and Graphs Sorting and searching algorithms.
(c) University of Washington20-1 CSC 143 Java Trees.
DATA STRUCURES II CSC QUIZ 1. What is Data Structure ? 2. Mention the classifications of data structure giving example of each. 3. Briefly explain.
CPS120: Introduction to Computer Science Nell Dale John Lewis Abstract Data Types.
INTRODUCTION TO DATA STRUCTURES 1. DATA STRUCTURES A data structure is a scheme for organizing data in the memory of a computer. Some of the more commonly.
CPS120: Introduction to Computer Science Sorting.
An Introduction to Programming Using Alice Data Structures.
Mohammed I DAABO COURSE CODE: CSC 355 COURSE TITLE: Data Structures.
Planning & System installation
Top 50 Data Structures Interview Questions
Data Structure Interview Question and Answers
Introduction to Data Structures
Introduction to Data Structure
Introduction to Data Structures
structures and their relationships." - Linus Torvalds
Introduction to Data Structures
Chapter 2 The Big Picture.
Linear Search Binary Search Tree
Important Problem Types and Fundamental Data Structures
OPIM 915 Fall 2010 Data Structures 23-38,
structures and their relationships." - Linus Torvalds
Presentation transcript:

Data Structures IS 101Y/CMSC 101 Computational Thinking and Design Thursday, October 3, 2013 Marie desJardins University of Maryland, Baltimore County

Quiz Individual quiz: 5 minutes Team quiz: 5 minutes

Data Structures Definition: A particular way of storing and organizing data in a computer so that it can be used efficiently Examples Variable – a single data element - the simplest data structure Array – an ordered list of data elements Tree – stay tuned Graph – ditto Priority, FIFO and LIFO queues – sorted arrays Tuple – a defined collection of related data elements

Trees A set of nodes and edges An edge between two nodes indicates there is some sort of relationship between them No circular relationships Has a “root” node and “leaf” nodes Examples Telephone tree Family tree Functional decomposition

Tree Exercise Use a tree to alphabetize yourselves Who is the root of your tree? Who are the leaves?

Graphs A set of nodes and edges An edge between two nodes indicates there is some sort of relationship between them No circular relationships Examples Maps Social networks Semantic networks

Semantic Network Exercise Exercise – random collection of (large) objects on the floor in the middle of the classroom Cell phone T-shirt Book Hat Skillet Spatula Lamp Piece of fruit Bag of chips Other kind of shirt Light bulb Ear buds Flashlight Batteries Some sort of connectors – several different colors Yarn and tape? How are the objects related – identify different kinds of relationships Is part of Same color Similar function Same general category of thing Used together Have students suggest different kinds of relationships – use yarn of different colors to connect objects with different kinds of relationships NOTE: I can put together a “kit” of all these things that we can both use

Semantic Network A graph where the nodes represent concepts and the edges represent relationships between those concepts Used to organize complex information Examples Ontologies – includes terms and definitions in a particular domain, e.g. medicine, architecture Brainstorming – some techniques use a semantic network as a way to capture the results of the brainstorming The human brain?

Recursion A structure or process that is defined self-referentially Recursive definition of a list of items: A list is either: an empty list (no items) or a single item followed by a list Recursive definition of an algorithm for searching for a particular item in a list: Find the middle item in the list If that’s the item you’re looking for You’re done Else Search the first half of the list Search the second half of the list

Semester Game What information needs to be stored? How might you organize it? By week? By choice? By outcome? Could you use a tree? Could you use a graph?

Data Design for the Semester Game For each week, what do you need to keep track of?

Similarly, for Crash For each “floating animal”, what do we need to keep track of? image – the picture of the animal xpos – the current X position of the picture ypos – the current Y position of the picture xdir – the current horizontal direction and speed ydir – the current vertical direction and speed times – how long the picture has been on the screen Solution: we’re using an array for each of these data items (see CrashBasics.pde)

NOTICE: Important Project Hint Coming up!!!

Data Design for the Semester Game Crash, conceptually, is a very similar problem to the Semester Game The same approach (using arrays) that we used in CrashBasics can be used for the Semester Game.