SlideShare ist ein Scribd-Unternehmen logo
1 von 21
DATA STRUCTURE
ChApTER – 1
inTRoDUCTion AnD ovERviEw
Recommended books
 Data Structures By Seymour Lipschutz
[Schaum’s Outline]
 An Introduction to Data structures with
Applications by Tremblay and Sorenson
LECTURE 1 ConTEnTS:-
 Overview
 Basic Terminology
 Introduction to Data Structure
 Data Structure Types
 Data Structure Operations
 Selecting a data structure
ovERviEw:-
 The study of computer science teaches us how to
use computers and how to organize the data so
that they can be manipulated by a program.
 The term data structure refers to a scheme for
organizing data into memory.
 Organization of data in some cases is of immense
importance. Therefore, the data will be stored in a
special way so that the required result should be
calculated as fast as possible.
BASiC TERminoLogy:
 DATA: Data are simply values or set of values. Or
data is raw material which we fed in computer for
processing.
 DATA iTEmS: A data item refers to a single unit of
values.
 gRoUp iTEmS: Data items that are divided into
sub items are called group items.
e.g an employee’s name may divide into three
sub items, first name, middle name, and last
name.
 infoRmATion: Meaningful or processed data.
 EnTiTy: An entity is something that has certain
attributes or properties which may assigned
values.
 In data structure collection of data is frequently
organized in to hierarchy of fields, records and
files.
 fiELD: a field is an single elementary unit of
information representing an attribute of an entity.
 RECoRD: A record is a collection of field values of a
given entity.
 fiLE: A file is a collection of records of the entities
in a given entity set.
Attributes Name Age Address NIC No
Values
Ali 24 Hyd 41303123
Azam 22 Khi 41303254
Adnan 21 Lahore 41312549
Field
Record
File
IntroductIon to data
Structure:
data Structure: A data structure is
specialized format for organizing and storing data.
or
In computer science, a data Structure is a
way of storing data in a computer memory so that
it can be used efficiently.
Importance of Data Structure
 Let’s discuss why we need data structures and what sort of
problems can be solved with their use. Data structures help us to
organize the data in the computer, resulting in more efficient
programs.
 An efficient program executes faster and helps minimize the
usage of resources like memory, disk.
 Computers are getting more powerful with the passage of time
with the increase in CPU speed in GHz, availability of faster
network and the maximization of disk space. Therefore people
have started solving more and more complex problems.
 As computer applications are becoming complex, so there is
need for more resources. This does not mean that we should buy
a new computer to make the application execute faster. Our
effort should be to ensue that the solution is achieved with the
help of programming, data structures and algorithm.
What does organizing the data
mean?
 It means that the data should be arranged in a way that it
is easily accessible.
 Because data is inside the computer and we want to see it.
We may also perform some calculations on it.
 Suppose the data contains some numbers and the
programmer wants to calculate the average, standard
deviation etc. May be we have a list of names and want to
search a particular name in it. To solve such problems,
data structures and algorithm are used.
 Sometimes you may realize that the application is too slow
and taking more time. There are chances that it may be
due to the data structure used, not due to the CPU speed
and memory.
data Structure typeS:-
 Data structure are classified either Linear or non-
linear.
 LInear data Structure: A data structure is linear if every
item is related (or attached) to its pervious and next item (e.g
Array, Linked list)
 non-LInear data Structure: A data structure is non-linear if
every item is attached to many other items in specific ways to
reflect relationships (e.g Trees)
data StructureS typeS
cont….
Linear
Data Structure
Non-Linear
Array
Linked List
Stack
Queues
etc.
Trees
Graphs
data Structure
operatIonS:-
 The data appearing in our data structure is
processed by means of certain operations.
 The following four operations play a major role:
 Transversing
 Searching
 Inserting
 Deleting
 Transversing: Accessing each record exactly once so that
certain items in the record may be processed.
This accessing or processing is sometimes called ‘visiting’ the
records.
 searching: finding the location of the record or finding the
location of all records, which satisfy one or more conditions.
 inserTing: Adding new records to the structure.
 DeleTing: Removing a record from the structure.
Sometimes two or more operations may be used in a given
situation; e.g we may want to delete the record which may
mean we first need to search for record and then delete it from
structure.
DaTa sTrucTure operaTions conT…
 The following two operations which are used in
special situations will also be considered.
 sorTing: Arranging the records in some logical
orders.
 Merging: Combining the records in two
different sorted files into a single file.
selecTing a DaTa sTrucTure:-
 How we can select the data structure?
 There are different kinds of data structure suited to different
kinds of applications and some are highly specialized to
certain tasks.
 Whenever we need to select a data structure we must keep
some points in mind.
 Select the data structure as follows:
 First of all, we have to analyze the problem to
determine the resources constraints that a
solution must meet.
 Secondly, it is necessary to determine the basic
operations that must be supported. Quantify
the resources constraints for each operations.
 Finally, select the data structure that meets
these requirements the maximum.
Algorithm Design/Specifications
 Algorithm: Finite set of instructions that, if followed,
accomplishes a particular task.
 Describe: in natural language / pseudo-code /
diagrams / etc.
 Criteria to follow:
 Input: Zero or more quantities (externally produced)
 Output: One or more quantities
 Definiteness: Clarity, precision of each instruction
 Effectiveness: Each instruction has to be basic
enough and feasible
 Finiteness: The algorithm has to stop after a finite
(may be very large) number of steps
16
Implementation, Testing and Maintenance
 Implementation
 Decide on the programming language to use
 C, C++, Python, Java, Perl, etc.
 Write clean, well documented code
 Test, test, test
 Integrate feedback from users, fix bugs,
ensure compatibility across different
versions  Maintenance 17
Algorithm Analysis
 Space complexity
 How much space is required
 Time complexity
 How much time does it take to run the
algorithm
18
Space Complexity
 Space complexity = The amount of memory
required by an algorithm to run to completion
 the most often encountered cause is “memory
leaks” – the amount of memory required larger
than the memory available on a given system
 Some algorithms may be more efficient if data
completely loaded into memory
 Need to look also at system limitations
 e.g. Classify 2GB of text in various categories –
can I afford to load the entire collection?
19
Space Complexity (cont…)
1. Fixed part: The size required to store certain
data/variables, that is independent of the size of the
problem:
- e.g. name of the data collection
1. Variable part: Space needed by variables, whose
size is dependent on the size of the problem:
- e.g. actual text
- load 2GB of text VS. load 1MB of text
20
Time Complexity
 Often more important than space complexity
 space available tends to be larger and larger
 time is still a problem for all of us
 3-4GHz processors on the market
 still …
 researchers estimate that the computation of
various transformations for 1 single DNA chain for
one single protein on 1 TerraHZ computer would
take about 1 year to run to completion
 Algorithms running time is an important issue
21

Weitere ähnliche Inhalte

Was ist angesagt?

Types of databases
Types of databasesTypes of databases
Types of databases
PAQUIAAIZEL
 
File access methods.54
File access methods.54File access methods.54
File access methods.54
myrajendra
 
Fundamentals of data structures ellis horowitz & sartaj sahni
Fundamentals of data structures   ellis horowitz & sartaj sahniFundamentals of data structures   ellis horowitz & sartaj sahni
Fundamentals of data structures ellis horowitz & sartaj sahni
Hitesh Wagle
 

Was ist angesagt? (20)

Unit 1 introduction to data structure
Unit 1   introduction to data structureUnit 1   introduction to data structure
Unit 1 introduction to data structure
 
UNIT II LINEAR DATA STRUCTURES – STACKS, QUEUES
UNIT II 	LINEAR DATA STRUCTURES – STACKS, QUEUES	UNIT II 	LINEAR DATA STRUCTURES – STACKS, QUEUES
UNIT II LINEAR DATA STRUCTURES – STACKS, QUEUES
 
Types of databases
Types of databasesTypes of databases
Types of databases
 
Binary search tree(bst)
Binary search tree(bst)Binary search tree(bst)
Binary search tree(bst)
 
Presentation on Data Structure
Presentation on Data StructurePresentation on Data Structure
Presentation on Data Structure
 
Data Representation
Data RepresentationData Representation
Data Representation
 
Linear search-and-binary-search
Linear search-and-binary-searchLinear search-and-binary-search
Linear search-and-binary-search
 
Dbms 7: ER Diagram Design Issue
Dbms 7: ER Diagram Design IssueDbms 7: ER Diagram Design Issue
Dbms 7: ER Diagram Design Issue
 
Introduction to data structure
Introduction to data structure Introduction to data structure
Introduction to data structure
 
b+ tree
b+ treeb+ tree
b+ tree
 
File access methods.54
File access methods.54File access methods.54
File access methods.54
 
Ntroduction to computer architecture and organization
Ntroduction to computer architecture and organizationNtroduction to computer architecture and organization
Ntroduction to computer architecture and organization
 
Data structure & its types
Data structure & its typesData structure & its types
Data structure & its types
 
Two dimensional array
Two dimensional arrayTwo dimensional array
Two dimensional array
 
Introduction to databases
Introduction to databasesIntroduction to databases
Introduction to databases
 
Binary Search
Binary SearchBinary Search
Binary Search
 
Data structure and algorithm using java
Data structure and algorithm using javaData structure and algorithm using java
Data structure and algorithm using java
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
Bubble sort
Bubble sortBubble sort
Bubble sort
 
Fundamentals of data structures ellis horowitz & sartaj sahni
Fundamentals of data structures   ellis horowitz & sartaj sahniFundamentals of data structures   ellis horowitz & sartaj sahni
Fundamentals of data structures ellis horowitz & sartaj sahni
 

Ähnlich wie Chapter 1( intro & overview)

DSA 1- Introduction.pdf
DSA 1- Introduction.pdfDSA 1- Introduction.pdf
DSA 1- Introduction.pdf
AliyanAbbas1
 
Database Management Systems ( Dbms )
Database Management Systems ( Dbms )Database Management Systems ( Dbms )
Database Management Systems ( Dbms )
Patty Buckley
 

Ähnlich wie Chapter 1( intro & overview) (20)

Lect 1-2
Lect 1-2Lect 1-2
Lect 1-2
 
Lect 1-2 Zaheer Abbas
Lect 1-2 Zaheer AbbasLect 1-2 Zaheer Abbas
Lect 1-2 Zaheer Abbas
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
Lecture1 data structure(introduction)
Lecture1 data structure(introduction)Lecture1 data structure(introduction)
Lecture1 data structure(introduction)
 
Data Structures & Algorithms
Data Structures & AlgorithmsData Structures & Algorithms
Data Structures & Algorithms
 
Lec1
Lec1Lec1
Lec1
 
Lec1
Lec1Lec1
Lec1
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
 
Lesson 1 - Data Structures and Algorithms Overview.pdf
Lesson 1 - Data Structures and Algorithms Overview.pdfLesson 1 - Data Structures and Algorithms Overview.pdf
Lesson 1 - Data Structures and Algorithms Overview.pdf
 
Lect1.pptx
Lect1.pptxLect1.pptx
Lect1.pptx
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdf
 
DBMS Full.ppt
DBMS Full.pptDBMS Full.ppt
DBMS Full.ppt
 
DSA 1- Introduction.pdf
DSA 1- Introduction.pdfDSA 1- Introduction.pdf
DSA 1- Introduction.pdf
 
UNIT II.docx
UNIT II.docxUNIT II.docx
UNIT II.docx
 
Lesson 1 overview
Lesson 1   overviewLesson 1   overview
Lesson 1 overview
 
Data Structure Introduction chapter 1
Data Structure Introduction chapter 1Data Structure Introduction chapter 1
Data Structure Introduction chapter 1
 
Iare ds lecture_notes_2
Iare ds lecture_notes_2Iare ds lecture_notes_2
Iare ds lecture_notes_2
 
Presentaion on data structure mms-a-28
Presentaion on  data structure mms-a-28Presentaion on  data structure mms-a-28
Presentaion on data structure mms-a-28
 
Database Management Systems ( Dbms )
Database Management Systems ( Dbms )Database Management Systems ( Dbms )
Database Management Systems ( Dbms )
 

Kürzlich hochgeladen

Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
gajnagarg
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
ahmedjiabur940
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
wsppdmt
 
Computer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfComputer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdf
SayantanBiswas37
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
Health
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
gajnagarg
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
chadhar227
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
ranjankumarbehera14
 

Kürzlich hochgeladen (20)

20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
 
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
 
Dubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls DubaiDubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls Dubai
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
 
Computer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfComputer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdf
 
Kings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about themKings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about them
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
 
7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.ppt7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.ppt
 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
 
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
 

Chapter 1( intro & overview)

  • 1. DATA STRUCTURE ChApTER – 1 inTRoDUCTion AnD ovERviEw
  • 2. Recommended books  Data Structures By Seymour Lipschutz [Schaum’s Outline]  An Introduction to Data structures with Applications by Tremblay and Sorenson
  • 3. LECTURE 1 ConTEnTS:-  Overview  Basic Terminology  Introduction to Data Structure  Data Structure Types  Data Structure Operations  Selecting a data structure
  • 4. ovERviEw:-  The study of computer science teaches us how to use computers and how to organize the data so that they can be manipulated by a program.  The term data structure refers to a scheme for organizing data into memory.  Organization of data in some cases is of immense importance. Therefore, the data will be stored in a special way so that the required result should be calculated as fast as possible.
  • 5. BASiC TERminoLogy:  DATA: Data are simply values or set of values. Or data is raw material which we fed in computer for processing.  DATA iTEmS: A data item refers to a single unit of values.  gRoUp iTEmS: Data items that are divided into sub items are called group items. e.g an employee’s name may divide into three sub items, first name, middle name, and last name.  infoRmATion: Meaningful or processed data.  EnTiTy: An entity is something that has certain attributes or properties which may assigned values.
  • 6.  In data structure collection of data is frequently organized in to hierarchy of fields, records and files.  fiELD: a field is an single elementary unit of information representing an attribute of an entity.  RECoRD: A record is a collection of field values of a given entity.  fiLE: A file is a collection of records of the entities in a given entity set. Attributes Name Age Address NIC No Values Ali 24 Hyd 41303123 Azam 22 Khi 41303254 Adnan 21 Lahore 41312549 Field Record File
  • 7. IntroductIon to data Structure: data Structure: A data structure is specialized format for organizing and storing data. or In computer science, a data Structure is a way of storing data in a computer memory so that it can be used efficiently.
  • 8. Importance of Data Structure  Let’s discuss why we need data structures and what sort of problems can be solved with their use. Data structures help us to organize the data in the computer, resulting in more efficient programs.  An efficient program executes faster and helps minimize the usage of resources like memory, disk.  Computers are getting more powerful with the passage of time with the increase in CPU speed in GHz, availability of faster network and the maximization of disk space. Therefore people have started solving more and more complex problems.  As computer applications are becoming complex, so there is need for more resources. This does not mean that we should buy a new computer to make the application execute faster. Our effort should be to ensue that the solution is achieved with the help of programming, data structures and algorithm.
  • 9. What does organizing the data mean?  It means that the data should be arranged in a way that it is easily accessible.  Because data is inside the computer and we want to see it. We may also perform some calculations on it.  Suppose the data contains some numbers and the programmer wants to calculate the average, standard deviation etc. May be we have a list of names and want to search a particular name in it. To solve such problems, data structures and algorithm are used.  Sometimes you may realize that the application is too slow and taking more time. There are chances that it may be due to the data structure used, not due to the CPU speed and memory.
  • 10. data Structure typeS:-  Data structure are classified either Linear or non- linear.  LInear data Structure: A data structure is linear if every item is related (or attached) to its pervious and next item (e.g Array, Linked list)  non-LInear data Structure: A data structure is non-linear if every item is attached to many other items in specific ways to reflect relationships (e.g Trees)
  • 11. data StructureS typeS cont…. Linear Data Structure Non-Linear Array Linked List Stack Queues etc. Trees Graphs
  • 12. data Structure operatIonS:-  The data appearing in our data structure is processed by means of certain operations.  The following four operations play a major role:  Transversing  Searching  Inserting  Deleting
  • 13.  Transversing: Accessing each record exactly once so that certain items in the record may be processed. This accessing or processing is sometimes called ‘visiting’ the records.  searching: finding the location of the record or finding the location of all records, which satisfy one or more conditions.  inserTing: Adding new records to the structure.  DeleTing: Removing a record from the structure. Sometimes two or more operations may be used in a given situation; e.g we may want to delete the record which may mean we first need to search for record and then delete it from structure.
  • 14. DaTa sTrucTure operaTions conT…  The following two operations which are used in special situations will also be considered.  sorTing: Arranging the records in some logical orders.  Merging: Combining the records in two different sorted files into a single file.
  • 15. selecTing a DaTa sTrucTure:-  How we can select the data structure?  There are different kinds of data structure suited to different kinds of applications and some are highly specialized to certain tasks.  Whenever we need to select a data structure we must keep some points in mind.  Select the data structure as follows:  First of all, we have to analyze the problem to determine the resources constraints that a solution must meet.  Secondly, it is necessary to determine the basic operations that must be supported. Quantify the resources constraints for each operations.  Finally, select the data structure that meets these requirements the maximum.
  • 16. Algorithm Design/Specifications  Algorithm: Finite set of instructions that, if followed, accomplishes a particular task.  Describe: in natural language / pseudo-code / diagrams / etc.  Criteria to follow:  Input: Zero or more quantities (externally produced)  Output: One or more quantities  Definiteness: Clarity, precision of each instruction  Effectiveness: Each instruction has to be basic enough and feasible  Finiteness: The algorithm has to stop after a finite (may be very large) number of steps 16
  • 17. Implementation, Testing and Maintenance  Implementation  Decide on the programming language to use  C, C++, Python, Java, Perl, etc.  Write clean, well documented code  Test, test, test  Integrate feedback from users, fix bugs, ensure compatibility across different versions  Maintenance 17
  • 18. Algorithm Analysis  Space complexity  How much space is required  Time complexity  How much time does it take to run the algorithm 18
  • 19. Space Complexity  Space complexity = The amount of memory required by an algorithm to run to completion  the most often encountered cause is “memory leaks” – the amount of memory required larger than the memory available on a given system  Some algorithms may be more efficient if data completely loaded into memory  Need to look also at system limitations  e.g. Classify 2GB of text in various categories – can I afford to load the entire collection? 19
  • 20. Space Complexity (cont…) 1. Fixed part: The size required to store certain data/variables, that is independent of the size of the problem: - e.g. name of the data collection 1. Variable part: Space needed by variables, whose size is dependent on the size of the problem: - e.g. actual text - load 2GB of text VS. load 1MB of text 20
  • 21. Time Complexity  Often more important than space complexity  space available tends to be larger and larger  time is still a problem for all of us  3-4GHz processors on the market  still …  researchers estimate that the computation of various transformations for 1 single DNA chain for one single protein on 1 TerraHZ computer would take about 1 year to run to completion  Algorithms running time is an important issue 21