Upcoming SlideShare
×

# Dsc -session01_introduction_to_data_structures_v2_1_.2

596 views
544 views

Published on

Published in: Education, Technology
2 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total views
596
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
23
0
Likes
2
Embeds 0
No embeds

No notes for slide

### Dsc -session01_introduction_to_data_structures_v2_1_.2

1. 1. Module: Data Structures with CIntroduction to Data Structures C3: Protected
3. 3. Introduction to Data Structures: OverviewIntroduction: The session briefly explains about what a data structure is, what are the different data structures available, and how to decide on the data structure to be used for a particular application. 3 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved
4. 4. Introduction to Data Structures: Objectives Objective:After completing this session, you will be able to: Define a data structure List the types of data structures Identify how to analyze and select data structure for a particular application 4 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved
5. 5. OverviewData type - specification of a set of data andthe characteristics for that data.Data structure - actual implementation of thedata type. Examples: Arrays Stack Queue Lists 5 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved
6. 6. Abstract Data TypeDefinition - a data type together with theoperations, whose properties are specifiedindependently of any particularimplementation.Implementation details are not considered.The definition can be mathematical or canbe programmed as an interface. 6 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved
7. 7. Types of Data StructuresLinear structures: A data structure is said to be linear if its elements form a sequence or a linear list.Hash tables: A hash table, or a hash map, is a data structure that associates keys with values.Trees: A tree can be viewed as a branching structure with no loopsGraph: A graph is a data structure, that consists of a set of nodes and a set of edges that establish relationships (connections) between the nodes. 7 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved
8. 8. Selecting a Data StructureSelecting a Data Structure begins fromchoice of an appropriate Abstract Data TypeADT.Abstract Data Structure: An abstract storagefor data defined in terms of the set ofoperations to be performed on the data andcomputational complexity for performingthese operations. This is regardless of theimplementation in a concrete data structure. 8 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved
9. 9. Selecting a Data Structure (Contd.)Selection of an abstract data structure iscrucial in the design of efficient algorithmsand in estimating their computationalcomplexity.Selection of concrete data structures isimportant for efficient implementation ofalgorithms. 9 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved
10. 10. Performance Analysis and MeasurementsSpace and time complexity: Space complexity: The amount of main memory needed to execute a program (space for program and data) till it produces output. Time complexity: Total CPU time taken by a program during execution till it produces output.Complexity can be classified into the following threecategories. Best Case: The minimum CPU time taken by a program. Worst Case: The maximum CPU time taken by a program. Average Case: The average CPU time taken by a program. 10 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved
11. 11. Big O NotationBig O notation: A mathematical notation used to describe the asymptotic behavior of functions. Used to characterize a functions behavior for very large / very small inputs in a simple but rigorous way that enables comparison to other functions. Notations: O Ω Θ 11 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved
12. 12. Big O Notation (Contd.)The Big O notation is used to measure: The complexity of algorithms The efficiency of algorithmsUsed to express an ordering property amongfunctions.T(N) – gives the amount of the resource(usually time or the count of some specificoperation) consumed when the input to thealgorithm is of size N. 12 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved