1 / 11

Data Structures

Data Structures. Main Concepts. Data Structures Stacks, queues, lists, trees, hash tables Algorithms Searching, sorting, recursion, analysis of running time. Definitions.

wolfe
Télécharger la présentation

Data Structures

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Data Structures

  2. Main Concepts • Data Structures • Stacks, queues, lists, trees, hash tables • Algorithms • Searching, sorting, recursion, analysis of running time Lecture 1: Introduction

  3. Definitions • A data structure is an organized collection of data with specific aggregate properties or “a systematic way of organizing and accessing data” in a computer’s memory • An algorithm is a sequence of program instructions designed to compute a particular result Lecture 1: Introduction

  4. Data Structure Main Concepts “ A systematic way of organizing and accessing data” in a computer’s memory We use variables to store data in a computer’s memory. Does that mean that variables are data structures? Lecture 1: Introduction

  5. Data Structure Main Concepts “ A systematic way of organizing and accessing data” in a computer’s memory We use variables to store data in a computer’s memory. Does that mean that variables are data structures? No. When we talk about data structures, we are referring to programming elements that can hold a lot of data, like an array. Lecture 1: Introduction

  6. Data Structures as Tools Main Concepts • Data structures are tools that we use in our programs • Good data structures and algorithms are necessary for efficiency and speed in our applications • We will study • The most important data structures & algorithms • How to make them • How to use them • How to measure their performance • How to find readymade tools Lecture 1: Introduction

  7. Data Structure Main Concepts Important things to remember about any data structure: • How are the data related? • For example, are they in a sequence? • This is the “organizing” part • What operations can be performed on the data? • This is the “accessing” part Lecture 1: Introduction

  8. Data Structure Example Main Concepts Stack = data structure that stores data elements which are inserted or removed in LIFO (last-in first-out) order How are the data related? • Stored in a linear sequence determined by the insertion order What operations can be performed on the data? • Basic Operations on Stack • -  Push (Insertion) • - Pop (Deletion) Uses: • Backtracking • Storing addresses in a Web browser’s history • Implementing an “undo” feature by storing changes • Reversing data • Parsing Lecture 1: Introduction

  9. Algorithm Main Concepts • Definition of Algorithm(after Al Kho-war-iz-mi a 9th century Persian mathematician) – • An ordered sequence of unambiguous and well-defined instructions that performs some task and halts in finite time  • an ordered sequence means that you can number the steps • unambiguous and well-defined instructions means that each instruction is clear, do-able, and can be done without difficulty • performs some task • halts in finite time (algorithms terminate!) Lecture 1: Introduction

  10. Abstract Data Type • A specification for a data structure that tells us • The type of data stored • The operations that are supported • Specifies what the operations do, but not how they do it Lecture 1: Introduction

  11. Five Steps per Datatype • Understand it Abstractly • Write a Specification • Write Applications • Implement • Analyze the Implementation Lecture 1: Introduction

More Related