Introduction to Data Structures

Slides:



Advertisements
Similar presentations
Chapter 1: INTRODUCTION TO DATA STRUCTURE
Advertisements

Chapter 9: Searching, Sorting, and Algorithm Analysis
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 206 Introduction to Computer Science II 09 / 10 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 09 / 05 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 01 / 28 / 2009 Instructor: Michael Eckmann.
DATA STRUCTURE Subject Code -14B11CI211.
Data Structures Lecture-1:Introduction
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. Definition Data structure is representation of the logical relationship existing between individual elements of data.
Computer Science Department Data Structures and Algorithms Lecture 1.
Analysis of Algorithms These slides are a modified version of the slides used by Prof. Eltabakh in his offering of CS2223 in D term 2013.
1 Introduction to Data Structures. 2 Course Name : Data Structure (CSI 221) Course Teacher : Md. Zakir Hossain Lecturer, Dept. of Computer Science Stamford.
 DATA STRUCTURE DATA STRUCTURE  DATA STRUCTURE OPERATIONS DATA STRUCTURE OPERATIONS  BIG-O NOTATION BIG-O NOTATION  TYPES OF DATA STRUCTURE TYPES.
Data Structures and Algorithms Lecture 1 Instructor: Quratulain Date: 1 st Sep, 2009.
Data Structure Introduction.
Data Structures Types of Data Structure Data Structure Operations Examples Choosing Data Structures Data Structures in Alice.
Elementary Data Organization. Outline  Data, Entity and Information  Primitive data types  Non primitive data Types  Data structure  Definition 
CS 206 Introduction to Computer Science II 09 / 18 / 2009 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 01 / 30 / 2009 Instructor: Michael Eckmann.
REEM ALMOTIRI Information Technology Department Majmaah University.
Data Structure and Algorithms
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture1.
Mohammed I DAABO COURSE CODE: CSC 355 COURSE TITLE: Data Structures.
Introduction toData structures and Algorithms
CS1022 Computer Programming & Principles
Data Structure and Algorithms
Advanced Sorting 7 2  9 4   2   4   7
CMPT 438 Algorithms.
Introduction to Data Structures
Design and Analysis of Algorithms
Data Structure By Amee Trivedi.
Chapter 12 – Data Structures
Course Developer/Writer: A. J. Ikuomola
Data Structures Michael J. Watts
INLS 623– Database Systems II– File Structures, Indexing, and Hashing
CHP - 9 File Structures.
Top 50 Data Structures Interview Questions
Data Structures & File Processing
Data Structure Interview Question and Answers
Introduction to Search Algorithms
Introduction to complexity
Data structure – is the scheme of organizing related information.
Lecture – 2 on Data structures
DATA STRUCTURES AND OBJECT ORIENTED PROGRAMMING IN C++
Data Structures Data Structure is a way of collecting and organising data in such a way that we can perform operations on these data in an effective.
Data Structures Interview / VIVA Questions and Answers
Introduction to Algorithms
Review Graph Directed Graph Undirected Graph Sub-Graph
Hashing Exercises.
DATA STRUCTURES Introduction: Basic Concepts and Notations
Teach A level Computing: Algorithms and Data Structures
Introduction to Data Structure
Map interface Empty() - return true if the map is empty; else return false Size() - return the number of elements in the map Find(key) - if there is an.
Data Structures (CS212D) Overview & Review.
Algorithm An algorithm is a finite set of steps required to solve a problem. An algorithm must have following properties: Input: An algorithm must have.
Introduction to Data Structures
Data Structures Review Session
Data Structures: Introductory lecture
Week # 1: Overview & Review
Searching CLRS, Sections 9.1 – 9.3.
Algorithm Analysis Bina Ramamurthy CSE116A,B.
Data Structures (CS212D) Overview & Review.
Spreadsheets, Modelling & Databases
Introduction to Data Structure
Important Problem Types and Fundamental Data Structures
LINEAR DATA STRUCTURES
Algorithms and data structures: basic definitions
Data Structures and Algorithms Lecture-1: Introduction
Presentation transcript:

Introduction to Data Structures

Words of Wisdom We must understand that life is difficult, if we know and accept it, it is no longer difficult. • Do men think that they will be left alone on saying “We believe” and that they will not be tested? We did test those before them and Allah will certainly know those who are true from those who are false” Al-Quran (29:2-3).

Course Outline Introduction & Overview Preliminaries string Processing Arrays, Records Linked List Stack, Queues Trees Graphs & their applications Sorting and searching

Book “Data Structures” by Seymour Lipschutz,

Topic to be discuss Data, information , entity, field, record, file Data Structure. Types of Data Structure. Algorithms. Searching Topic to be discuss

Elementary Data Organization Data are simply values or sets of values. Data item may be divided into further sub item called group item. Entity is something that has certain attributes or properties which may be assigned values. Collection of data are frequently organized into a hierarchy of fields, records and files. Field is single element unit of information or a column in a table (holds data) For instance, field is use to store single item. . records is collection of field values of given entity. or is a row of data added to this table. Record may be variable length or fix length have same data type and same amount of space for each value. File is collection of records.

What is Data Structure ? Why it is used?

Data Structures Data may be organized in many different ways; The logical or mathematical model of a particular organization of data is called a data structure. Structure should be simple enough that one can effectively process the data when necessary. Choice of data structure depends on data type, frequency with which various data operation are applied . Data structure requires 3 basic things. Space require to store data. Time require for each basic function. Programming effort. Why use Data Structure? Data structure help us to organize the data in the computer, resulting in more efficient programs. An efficient program execute faster and helps minimize the use of resources like memory disk.

Figure: Linear and nonlinear structures Data Structures Types of Data Structure 1. Linear Data Structure Example: Arrays, Linked Lists, Stacks, Queues 2. Nonlinear Data Structure Example: Trees, Graphs A B C D E F Array A B C D E F Tree Figure: Linear and nonlinear structures

Types of Data Structure Stack:- Stack is linear type data structure it is called last in firs out(LIFO). In this structure insertion and deletion can take place only at one end called top of the list. Example is stack of dishes. Queue is linear data structure. It is called first in first out(FIFO) in which deletion take place only at one end of list the front and insertion take place only other end of queue the rear of list. Example people stay in row Waite for bus. Link List is linear type data structure consisting of group of nodes, which together represent a sequence. One contain data item and other contain reference. Tree is non linear data structure. In tree data frequently contain hierarchical relationship between various data elements. The data structure which reflect this relationship is called rooted tree graph.

Data Structure Operations Traversing: Accessing each record exactly once so that certain items in the record may be processed. 2. Searching: Finding the location of the record with a given key value. 3. Inserting: Adding a new record to the structure. 4. Deleting: Removing a record from the structure. 5. Sorting: Arranging the records in some logical order. 6. Merging: Combing the records in two different sorted files into a single sorted file.

Complexity of Algorithm Algorithms It is a well-defined set of instructions used to solve a particular problem. Time and space it uses are two major measure of the efficiency of an algorithm. Complexity of Algorithm The complexity of an algorithm M is the function f(n) which gives the running time and/or storage space requirement of the algorithm in terms of the size n of the input data. Two types of complexity 1. Time Complexity How long does this sorting program run? It possibly takes a very long time on large inputs (that is many strings) until the program has completed its work and gives a sign of life again.

Continue 2. Space Complexity The better the time complexity of an algorithm is, the faster the algorithm will carry out his work in practice. Apart from time complexity, its space complexity is also important: This is essentially the number of memory cells which an algorithm needs. A good algorithm keeps this number as small as possible, too.

Searching Algorithms There are two types of searching. Linear Searching Binary Searching Linear search Search each record of the file, one at time, until finding the given Name and hence the corresponding telephone number. It is simple form of searching but it take more time if there is millions of records. Binary search Compare the given name with the name in the middle of list; this tells which half of the list contain name. in this we need less comparison and we get required data in less time.

Typical Growth Rates Function Name c Constant logn Logarithmic log2n Log-squared n Linear nlogn n2 Quadratic n3 Cubic 2n Exponential