Introduction to Data Structures

Slides:



Advertisements
Similar presentations
Data Structures Michael J. Watts
Advertisements

Queues Chapter 6. Chapter Objectives  To learn how to represent a waiting line (queue) and how to use the methods in the Queue interface for insertion.
Binary Heaps CSE 373 Data Structures Lecture 11. 2/5/03Binary Heaps - Lecture 112 Readings Reading ›Sections
Heaps and heapsort COMP171 Fall Sorting III / Slide 2 Motivating Example 3 jobs have been submitted to a printer in the order A, B, C. Sizes: Job.
CS 104 Introduction to Computer Science and Graphics Problems Data Structure & Algorithms (4) Data Structures 11/18/2008 Yang Song.
Queues Chapter 6. Chapter 6: Queues2 Chapter Objectives To learn how to represent a waiting line (queue) and how to use the methods in the Queue interface.
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)
1 HEAPS & PRIORITY QUEUES Array and Tree implementations.
Chapter 12 Data Structure Associate Prof. Yuh-Shyan Chen Dept. of Computer Science and Information Engineering National Chung-Cheng University.
Introduction to Data Structures. About the document. The document is prepared by Prof. Shannon Bradshaw at Drew University. The key concepts in data structure.
9-1 Abstract Data Types Abstract data type A data type whose properties (data and operations) are specified independently of any particular implementation.
RIGHT Mouse Button Formatting Cut Copy Paste Save LEFT Mouse Button MAIN BUTTON Single clicks Double clicks Drag Highlight.
1 5. Abstract Data Structures & Algorithms 5.1 Data Structure Fundamentals.
Data Structures Types of Data Structure Data Structure Operations Examples Choosing Data Structures Data Structures in Alice.
1 5. Abstract Data Structures & Algorithms 5.1 Data Structure Fundamentals.
Data Structures Chapter 6. Data Structure A data structure is a representation of data and the operations allowed on that data. Examples: 1.Array 2.Record.
1 M I DAABO COURSE CODE: CSC 355 COURSE TITLE: Data Structures.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To introduce the basic concepts of linked lists ❏ To introduce the basic concepts.
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.
Nov 2, 2001CSE 373, Autumn Hash Table example marking deleted items + choice of table size.
1 Linked List. List vs Arrays Two built-in data structures that can be used to organize data, or to create other data structures: Lists Arrays.
An Introduction to Programming Using Alice Data Structures.
Mohammed I DAABO COURSE CODE: CSC 355 COURSE TITLE: Data Structures.
Fundamentals of Windows Mouse n 4 Basic Operations: –Pointing –Clicking –Double Clicking –Dragging.
Priority Queues and Heaps Tom Przybylinski. Maps ● We have (key,value) pairs, called entries ● We want to store and find/remove arbitrary entries (random.
CSE373: Data Structures & Algorithms Priority Queues
Partially Ordered Data ,Heap,Binary Heap
Data Structures.
Data Structure By Amee Trivedi.
Chapter 12 – Data Structures
Data Structures Michael J. Watts
Top 50 Data Structures Interview Questions
Data Structure Interview Question and Answers
Chapter 15 Lists Objectives
Word Lesson 2 Basic Editing
Programming Abstractions
Hashing Exercises.
CS Anya E. Vostinar Grinnell College
Introduction to Data Structure
Tree data structure.
Introduction to Data Structures
Heap Chapter 9 Objectives Upon completion you will be able to:
CMSC 341 Lecture 5 Stacks, Queues
structures and their relationships." - Linus Torvalds
original list {67, 33,49, 21, 25, 94} pass { } {67 94}
Trees and Binary Trees.
Chapter 15 Lists Objectives
Tree data structure.
Introduction to Data Structures
Lesson Objectives Aims
A Kind of Binary Tree Usually Stored in an Array
CSC 143 Queues [Chapter 7].
ITEC 2620M Introduction to Data Structures
Introduction to Data Structures
Hassan Khosravi / Geoffrey Tien
CS Data Structure: Heaps.
2-3-4 Trees Red-Black Trees
Data structures.
An Introduction to Programming Using Alice 2.2, Second Edition
Introduction to Data Structures
Priority Queues & Heaps
DATA STRUCTURE.
Important Problem Types and Fundamental Data Structures
Data Structures and Algorithm Analysis Priority Queues (Heaps)
OPIM 915 Fall 2010 Data Structures 23-38,
structures and their relationships." - Linus Torvalds
DATA STRUCTURES IN PYTHON
Presentation transcript:

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 used data structures include lists, arrays, stacks, queues, heaps, trees, and graphs. Binary Tree

Data Structures The way in which the data is organized affects the performance of a program for different tasks. Computer programmers decide which data structures to use based on the nature of the data and the processes that need to be performed on that data. Binary Tree

Example: A Queue A queue is an example of commonly used simple data structure. A queue has beginning and end, called the front and back of the queue. Data enters the queue at one end and leaves at the other. Because of this, data exits the queue in the same order in which it enters the queue, like people in a checkout line at a supermarket.

Example: A Binary Tree A binary tree is another commonly used data structure. It is organized like an upside down tree. Each spot on the tree, called a node, holds an item of data along with a left pointer and a right pointer. Binary Tree

Example: A Binary Tree The pointers are lined up so that the structure forms the upside down tree, with a single node at the top, called the root node, and branches increasing on the left and right as you go down the tree. Binary Tree

Choosing Data Structures By comparing the queue with the binary tree, you can see how the structure of the data affects what can be done efficiently with the data.

Choosing Data Structures A queue is a good data structure to use for storing things that need to be kept in order, such as a set of documents waiting to be printed on a network printer. .

Choosing Data Structures The jobs will be printed in the order in which they are received. Most network print servers maintain such a print queue. .

Choosing Data Structures A binary tree is a good data structure to use for searching sorted data. The middle item from the list is stored in the root node, with lesser items to the left and greater items to the right.

Choosing Data Structures A search begins at the root. The computer either find the data, or moves left or right, depending on the value for which you are searching. Each move down the tree cuts the remaining data in half.

Choosing Data Structures Items can be located very quickly in a tree. Telephone directory assistance information is stored in a tree, so that a name and phone number can be found quickly.

Choosing Data Structures For some applications, a queue is the best data structure to use. For others, a binary tree is better. Programmers choose from among many data structures based on how the data will be used by the program.

Data Structures LIST vs. Array Alice has two built-in data structures that can be used to organize data, or to create other data structures: Lists Arrays The Redo button will reverse the last use of the Undo button, restoring the previous action. The Ctrl-Y keyboard shortcut also can be used in place of the Redo button.

Lists A list is an ordered set of data. It is often used to store objects that are to be processed sequentially. A list can be used to create a queue. The Redo button will reverse the last use of the Undo button, restoring the previous action. The Ctrl-Y keyboard shortcut also can be used in place of the Redo button.

Arrays An array is an indexed set of variables, such as dancer[1], dancer[2], dancer[3],… It is like a set of boxes that hold things. A list is a set of items. An array is a set of variables that each store an item. The Redo button will reverse the last use of the Undo button, restoring the previous action. The Ctrl-Y keyboard shortcut also can be used in place of the Redo button.

Arrays and Lists You can see the difference between arrays and lists when you delete items. The Redo button will reverse the last use of the Undo button, restoring the previous action. The Ctrl-Y keyboard shortcut also can be used in place of the Redo button.

Arrays and Lists In a list, the missing spot is filled in when something is deleted. The Redo button will reverse the last use of the Undo button, restoring the previous action. The Ctrl-Y keyboard shortcut also can be used in place of the Redo button.

Arrays and Lists In an array, an empty variable is left behind when something is deleted. The Redo button will reverse the last use of the Undo button, restoring the previous action. The Ctrl-Y keyboard shortcut also can be used in place of the Redo button.