1 Introduction to Data Structures. 2 Course Name : Data Structure (CSI 221) Course Teacher : Md. Zakir Hossain Lecturer, Dept. of Computer Science Stamford.

Slides:



Advertisements
Similar presentations
Chapter 1: INTRODUCTION TO DATA STRUCTURE
Advertisements

Analysys & Complexity of Algorithms Big Oh Notation.
Computational Complexity 1. Time Complexity 2. Space Complexity.
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.
Algorithmic Complexity Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Not all algorithms are created equally Insertion of words from a dictionary into a sorted list takes a very long time. Insertion of the same words into.
Cmpt-225 Algorithm Efficiency.
CS 206 Introduction to Computer Science II 09 / 05 / 2008 Instructor: Michael Eckmann.
Computer Science 2 Data Structures and Algorithms V section 2 Intro to “big o” Lists Professor: Evan Korth New York University 1.
CHAPTER 2 ANALYSIS OF ALGORITHMS Part 1. 2 Big Oh and other notations Introduction Classifying functions by their asymptotic growth Theta, Little oh,
CS 206 Introduction to Computer Science II 01 / 28 / 2009 Instructor: Michael Eckmann.
HORSEED International University
Computer Science 2 Data Structures and Algorithms V Intro to “big o” Lists Professor: Evan Korth New York University 1.
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.
Algorithm Design and Analysis Liao Minghong School of Computer Science and Technology of HIT July, 2003.
Program Performance & Asymptotic Notations CSE, POSTECH.
Week 2 CS 361: Advanced Data Structures and Algorithms
Lecture 2 Computational Complexity
Algorithm Efficiency CS 110: Data Structures and Algorithms First Semester,
Mathematics Review and Asymptotic Notation
CSC 201 Analysis and Design of Algorithms Lecture 04: CSC 201 Analysis and Design of Algorithms Lecture 04: Time complexity analysis in form of Big-Oh.
1 Computer Algorithms Lecture 3 Asymptotic Notation Some of these slides are courtesy of D. Plaisted, UNC and M. Nicolescu, UNR.
Computer Science Department Data Structures and Algorithms Lecture 1.
Instructor Information: Dr. Radwa El Shawi Room: Week # 1: Overview & Review.
Algorithm Analysis PS5 due 11:59pm Wednesday, April 18 Final Project Phase 2 (Program Outline) due 1:30pm Tuesday, April 24 Wellesley College CS230.
DATA STRUCTURES (CS212D) Week # 1: Overview & Review.
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.
 DATA STRUCTURE DATA STRUCTURE  DATA STRUCTURE OPERATIONS DATA STRUCTURE OPERATIONS  BIG-O NOTATION BIG-O NOTATION  TYPES OF DATA STRUCTURE TYPES.
Algorithm Analysis (Algorithm Complexity). Correctness is Not Enough It isn’t sufficient that our algorithms perform the required tasks. We want them.
Data Structure Introduction.
Chapter 5 Algorithms (2) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Java Methods Big-O Analysis of Algorithms Object-Oriented Programming
Elementary Data Organization. Outline  Data, Entity and Information  Primitive data types  Non primitive data Types  Data structure  Definition 
1 Algorithms  Algorithms are simply a list of steps required to solve some particular problem  They are designed as abstractions of processes carried.
Foundations of Algorithms, Fourth Edition
CS 206 Introduction to Computer Science II 01 / 30 / 2009 Instructor: Michael Eckmann.
ADS 1 Algorithms and Data Structures 1 Syllabus Asymptotical notation (Binary trees,) AVL trees, Red-Black trees B-trees Hashing Graph alg: searching,
2 Obaid Ullah HOD Computer Science Dept. Superior University Sialkot Campus.
CSE332: Data Abstractions Lecture 12: Introduction to Sorting Dan Grossman Spring 2010.
DATA STRUCTURES (CS212D) Overview & Review Instructor Information 2  Instructor Information:  Dr. Radwa El Shawi  Room: 
REEM ALMOTIRI Information Technology Department Majmaah University.
Data Structure and Algorithms
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture1.
Ch03-Algorithms 1. Algorithms What is an algorithm? An algorithm is a finite set of precise instructions for performing a computation or for solving a.
Lecture 3COMPSCI.220.S1.T Running Time: Estimation Rules Running time is proportional to the most significant term in T(n) Once a problem size.
Introduction to Data Structures
Design and Analysis of Algorithms
Course Developer/Writer: A. J. Ikuomola
Data Structure Interview Question and Answers
Asymptotic Notations Algorithms perform f(n) basic operations to accomplish task Identify that function Identify size of problem (n) Count number of operations.
Lecture – 2 on Data structures
DATA STRUCTURES Introduction: Basic Concepts and Notations
Introduction to Data Structure
Data Structures (CS212D) Overview & Review.
Introduction to Algorithms Analysis
Asymptotic Notations Algorithms perform f(n) basic operations to accomplish task Identify that function Identify size of problem (n) Count number of operations.
BIG-OH AND OTHER NOTATIONS IN ALGORITHM ANALYSIS
Chapter 2: Fundamentals of the Analysis of Algorithm Efficiency
Advanced Analysis of Algorithms
Chapter 2.
PAC Intro to “big o” Lists Professor: Evan Korth New York University
Data Structures (CS212D) Overview & Review.
Introduction to Data Structures
Asymptotic Notations Algorithms perform f(n) basic operations to accomplish task Identify that function Identify size of problem (n) Count number of operations.
Introduction to Algorithm and its Complexity Lecture 1: 18 slides
Data Structures and Algorithms Lecture-1: Introduction
CMPT 225 Lecture 6 – Review of Complexity Analysis using the Big O notation + Comparing List ADT class implementations.
Presentation transcript:

1 Introduction to Data Structures

2 Course Name : Data Structure (CSI 221) Course Teacher : Md. Zakir Hossain Lecturer, Dept. of Computer Science Stamford University Bangladesh Class Schedule : Tuesday : 11:45 am - 1:00 pm Thursday : 1:00 pm – 2.15 pm Marks Distribution : Attendance - 10% Assignment – (5%+5%) Class Test - (10% +10%) Midterm - 30% Final - 30% Total - 100%

3 Course Outline 1.Concepts and examples 2.Elementary data objects 3.Elementary data structures 4.Arrays 5.Lists 6.Stacks 7.Queues 8.Graphs 9.Trees 10.Sorting and searching 11.Hash techniques

4 1. “ Theory and Problems of Data Structures” by Seymour Lipschutz, McGraw-Hill, ISBN Books

Elementary Data Organization Data are simply values or sets of values. Collection of data are frequently organized into a hierarchy of fields, records and files. This organization of data may not complex enough to maintain and efficiently process certain collections of data. For this reason, data are organized into more complex type of structures called Data Structures.

6 Data Structures  Data Structures The logical or mathematical model of a particular organization of data is called a data structure.  Types of Data Structure 1. Linear Data Structure Example: Arrays, Linked Lists, Stacks, Queues 2. Nonlinear Data Structure Example: Trees, Graphs A BC DE F ABCDEF Figure: Linear and nonlinear structures Array Tree

7 Choice of Data Structures The choice of data structures depends on two considerations: 1.It must be rich enough in structure to mirror the actual relationships of data in the real world. 2.The structure should be simple enough that one can effectively process data when necessary Figure 2: Array with 8 items Figure 3: Tree with 8 nodes

8 Data Structure Operations 1.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.

9 Algorithms It is a well-defined set of instructions used to solve a particular problem. Example: Write an algorithm for finding the location of the largest element of an array Data. Largest-Item (Data, N, Loc) 1. set k:=1, Loc:=1 and Max:=Data[1] 2. while k<=N repeat steps 3, 4 3. If Max < Data[k] then Set Loc:=k and Max:=Data[k] 4. Set k:=k+1 5. write: Max and Loc 6. exit

10 Complexity of Algorithms 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 2. Space Complexity

11 O-notation - A function f(n)=O(g(n)) if there are positive constants c and n 0 such that f(n) = n 0. - When f(n)=O(g(n)), it is guaranteed that f(n) grows at a rate no faster than g(n). So g(n) is an upper bound on f(n). Example: (a) f(n) = 3n+2 Here f(n) =1 So, f(n) = O(n). (b) f(n) = 3n 2 -2 Here f(n) =1 So, f(n) = O(n 2 ).

12 Rule-1 If f a (n) = O(g a (n)) and f b (n) = O((g b (n)) then (a) f a (n)+f b (n) = max(O(g a (n)),O(g b (n)) (b) f a (n) * f b (n) = O(g a (n) * g b (n)) Rule-2 If f(n) is a polynomial of degree k, then f(n) = Θ(n k ). Rule-3 Log k n = O(n) for any constant. Some rules related to asymptotic notation

FunctionName c Constant logn Logarithmic log 2 n Log-squared n Linear nlogn n 2 Quadratic n 3 Cubic 2 n Exponential 13 Typical Growth Rates