Copyright © Wondershare Software Introduction to Data Structures Prepared by: Eng. Ahmed & Mohamed Taha.

Slides:



Advertisements
Similar presentations
Linked Lists CSC220 Winter
Advertisements

Data Structures.
Overview of Data Structures and Algorithms
Binary Trees CSC 220. Your Observations (so far data structures) Array –Unordered Add, delete, search –Ordered Linked List –??
CS 171: Introduction to Computer Science II
Data Structures Data Structures Topic #13. Today’s Agenda Sorting Algorithms: Recursive –mergesort –quicksort As we learn about each sorting algorithm,
Lecture - 1 on Data Structures. Prepared by, Jesmin Akhter, Lecturer, IIT,JU Data Type and Data Structure Data type Set of possible values for variables.
CS 307 Fundamentals of Computer Science 1 Abstract Data Types many slides taken from Mike Scott, UT Austin.
CS 104 Introduction to Computer Science and Graphics Problems Data Structure & Algorithms (4) Data Structures 11/18/2008 Yang Song.
Review for Test 2 i206 Fall 2010 John Chuang. 2 Topics  Operating System and Memory Hierarchy  Algorithm analysis and Big-O Notation  Data structures.
Data Structures Data Structures Topic #8. Today’s Agenda Continue Discussing Table Abstractions But, this time, let’s talk about them in terms of new.
COMP 110 Introduction to Programming Mr. Joshua Stough.
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
DATA STRUCTURE Subject Code -14B11CI211.
C o n f i d e n t i a l HOME NEXT Subject Name: Data Structure Using C Unit Title: Trees.
Binary Trees Chapter 6.
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.
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.
Prof. Amr Goneid, AUC1 CSCE 210 Data Structures and Algorithms Prof. Amr Goneid AUC Part 1. Data Modeling and ADTs.
Comp 249 Programming Methodology Chapter 15 Linked Data Structure - Part B Dr. Aiman Hanna Department of Computer Science & Software Engineering Concordia.
Introduction to Data Structures. About the document. The document is prepared by Prof. Shannon Bradshaw at Drew University. The key concepts in data structure.
1 Hash Tables  a hash table is an array of size Tsize  has index positions 0.. Tsize-1  two types of hash tables  open hash table  array element type.
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.
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.
Introduction to Data Structures Fall 2008 Dr. David A. Gaitros
Min Chen School of Computer Science and Engineering Seoul National University Data Structure: Chapter 1.
Chapter 6 Binary Trees. 6.1 Trees, Binary Trees, and Binary Search Trees Linked lists usually are more flexible than arrays, but it is difficult to use.
© 2006 Pearson Addison-Wesley. All rights reserved13 B-1 Chapter 13 (continued) Advanced Implementation of Tables.
Chapter 13 B Advanced Implementations of Tables – Balanced BSTs.
Chapter 9 (modified) Abstract Data Types and Algorithms Nell Dale John Lewis.
DATA STRUCTURES & C# GENERICS Trent Spangler | Greg Phelps.
9-1 Abstract Data Types Abstract data type A data type whose properties (data and operations) are specified independently of any particular implementation.
Data structures Abstract data types Java classes for Data structures and ADTs.
INTRODUCTION TO DATA STRUCTURES. INTRODUCTION A data structure is nothing but an arrangement of data either in computer's memory or on the disk storage.
Lecture1 introductions and Tree Data Structures 11/12/20151.
Data Structures Lecture 1: Introduction. Course Contents Data Types   Overview, Introductory concepts   Data Types, meaning and implementation  
1 Linked-list, stack and queue. 2 Outline Abstract Data Type (ADT)‏ Linked list Stack Queue.
Data Structures Types of Data Structure Data Structure Operations Examples Choosing Data Structures Data Structures in Alice.
Data Abstaraction Chapter 10.
Elementary Data Organization. Outline  Data, Entity and Information  Primitive data types  Non primitive data Types  Data structure  Definition 
Collections Data structures in Java. OBJECTIVE “ WHEN TO USE WHICH DATA STRUCTURE ” D e b u g.
Review for Final Exam – cs411/511 Definitions (5 questions, 2 points each) Algorithm Analysis (3 questions, 3 points each) General Questions (3 questions,
Chapter 16 – Data Structures and Recursion. Data Structures u Built-in –Array –struct u User developed –linked list –stack –queue –tree Lesson 16.1.
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.
Data Structures for Midterm 2. C++ Data Structure Runtimes.
Prof. amr Goneid, AUC1 CSCE 110 PROGRAMMING FUNDAMENTALS WITH C++ Prof. Amr Goneid AUC Part 13. Abstract Data Types (ADT’s)
CSS446 Spring 2014 Nan Wang.  to study trees and binary trees  to understand how binary search trees can implement sets  to learn how red-black trees.
CSC212 Data Structure Lecture 16 Heaps and Priority Queues Instructor: George Wolberg Department of Computer Science City College of New York.
Course Code #IDCGRF001-A 5.1: Searching and sorting concepts Programming Techniques.
Stack and Queues Part 2. Priority Queues Priority Queues (cont’) A priority queue is a more specialized data structure than a stack or a queue. However,
 Saturday, April 20, 8:30-11:00am in B9201  Similar in style to written midterm exam  May include (a little) coding on paper  About 1.5 times as long.
Data Structure and Algorithms
Data Structure and Algorithm Introduction.  The manner in which computer program is being developed is not as simple as you may possibly think.  It.
Chapter 9 Abstract Data Types and Algorithms Nell Dale John Lewis.
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.
Mohammed I DAABO COURSE CODE: CSC 355 COURSE TITLE: Data Structures.
Stacks.
Data Structure By Amee Trivedi.
Course Developer/Writer: A. J. Ikuomola
Top 50 Data Structures Interview Questions
Red Black Trees
Introduction to Data Structure
structures and their relationships." - Linus Torvalds
structures and their relationships." - Linus Torvalds
Advanced Implementation of Tables
structures and their relationships." - Linus Torvalds
Presentation transcript:

Copyright © Wondershare Software Introduction to Data Structures Prepared by: Eng. Ahmed & Mohamed Taha

Copyright © Wondershare Software Company Logo Agenda  Data Structures and Algorithms.  Characteristics of Data Structures.  Abstract Data Types.  General form of any Data structure

Copyright © Wondershare Software Company Logo Data Structures  A data structure is an arrangement of data in a computer's memory or even disk storage.  An example of several common data structures are: arrays linked lists Queues Stacks binary trees hash tables.  Algorithms, on the other hand, are used to manipulate the data contained in these data structures such as searching and sorting algorithms.

Copyright © Wondershare Software Company Logo Algorithms  Many algorithms apply directly to a specific data structures. When working with certain data structures you need to know how to insert new data, search for a specified item, and deleting a specific item.  Commonly used algorithms are useful for: Searching for a particular data item (or record). Sorting the data. There are many ways to sort data. Simple sorting, Advanced sorting Iterating through all the items in a data structure. (Visiting each item in turn so as to display it or perform some other action on these items)

Copyright © Wondershare Software Company Logo Characteristics of Data Structures DisadvantagesAdvantagesData Structure Slow search Slow deletes Fixed size Quick inserts Fast access if index known Array 1 Slow inserts Slow deletes Fixed size Faster search than unsorted array Ordered Array 2 Slow access to other items Last-in, first-out LIFO access Stack 3 Slow access to other itemsFirst-in, first-out FIFO access Queue 4 Slow searchQuick inserts Quick deletes Linked List 5 Deletion algorithm is complex Quick search Quick inserts Quick deletes (If the tree remains balanced) Binary Tree 6

Copyright © Wondershare Software Company Logo Characteristics of Data Structures DisadvantagesAdvantagesData Structure Complex to implement Quick search Quick inserts Quick deletes (Tree always remains balanced) Red-Black Tree 7 Complex to implement Quick search Quick inserts Quick deletes (Tree always remains balanced) (Similar trees good for disk storage) Tree 8 Slow deletes Access slow if key is not known Inefficient memory usage Very fast access if key is known Quick inserts Hash Table 9 Slow access to other items Quick inserts Quick deletes Access to largest item Heap 10 Some algorithms are slow and very complex Best models real-world situations Graph 11 Cont.

Copyright © Wondershare Software Company Logo A red-black Tree A red-black tree is a binary search tree where each node has a color attribute, the value of which is either(red or black). In addition to the ordinary requirements imposed on binary search trees, the following additional requirements apply to red-black trees: 1.A node is either red or black. 2.The root is black. (This rule is sometimes omitted from other definitions. Since the root can always be changed from red to black but not necessarily vice-versa this rule has little effect on analysis.) 3.All leaves are black. 4.Both children of every red node are black. 5.Every simple path from a given node to any of its descendant leaves contains the same number of black nodes.

Copyright © Wondershare Software Company Logo A red-black Tree Example Cont.

Copyright © Wondershare Software Company Logo Abstract Data Types (ADT)   An Abstract Data Type (ADT) is more a way of looking at a data structure: focusing on what it does and ignoring how it does its job.   A stack or a queue is an example of an ADT. It is important to understand that both stacks and queues can be implemented using an array.   It is also possible to implement stacks and queues using a linked list. This demonstrates the "abstract" nature of stacks and queues: how they can be considered separately from their implementation.   To best describe the term Abstract Data Type, it is best to break the term down into "data type" and then "abstract".   data type: a data item with certain characteristics and the permissible operations on that data. An “int”, for example, can contain any whole-number value. It can also be used with the operators +, -, *, and /. understanding the type means understanding what operations can be performed on it.   Abstract: The word abstract in our context stands for "considered apart from the detailed specifications or implementation“. Consider for example the stack class. The end user knows that push() and pop() (amoung other similar methods) exist and how they work. The user doesn't and shouldn't have to know how push() and pop() work, or whether data is stored in an array, a linked list, or some other data structure like a tree.

Copyright © Wondershare Software Company Logo General form of any Data structure Data structure operations Insert item function Delete item function Search for an item function

Copyright © Wondershare Software Thank you !