SlideShare a Scribd company logo
1 of 2
Soln 1.
"Algorithm"referstothe setof instructions (where eachinstructionhasitsclearand defined
meaning) whichare intendedtosolve the problemwithfinite amountof effortinfinite periodof
time.
OR
In otherwords,AlgorithmmeansStepstoSolve the Problem.The solutiontoeveryproblemhas
stepsassociatedwithitthatare calledAlgorithms.
The characteristicsof Algorithmsare:
1. It shouldalwaysbe of finite lengthandterminatesinfinite no.of stepsandwithinfinite time.
2. It shouldhave 0 or more inputs (takenfromuser) andprovides1or more outputs(inrelationto
input).
3. The operationstobe performedneedstobe verybasicso that theycan be performedeasily&
efficientlyand infinite length.
4. The outputor actionsperformedshouldnotbe vague orunclear.
Soln 2.
Time complexityandSpace complexityare the factorsor part of AlgorithmAnalysis.
Algorithmanalysisisimportantinordertocheck whetherthe algorithmdesignedtosolve the
problemisefficientornot,intermsof Space usedbyit inmemoryandits Runningtime asfunction
of inputsize. We have bestcase (fastest),averagecase (prediction),worstcase (slowest)definedfor
everyalgorithm.
Time Complexityreferstostudyof time efficiencyof analgorithm asa functionof inputtoalgorithm
(no.of inputs) OR Amountof time takenbythe algorithmto solve the problemasfunctionof input
to the algorithm. The rate at whichfunctiongrowsasfunctionof input size iscalledGrowthof
Function.Itcan be constant,linear,quadratic,cubicetc.
Space Complexityreferstomemoryoccupiedorspace usedbyan algorithminthe mainmemory
withrespecttoinputsor as a functionof input to the algorithm.
We make use of AsymptoticNotationstocheckthe efficiencyof algorithm&we’ll alwaysprefer
algorithmwhichtakeslessmemory(i.e.,wastage isless) andterminatesinfinite time.
Soln 3.
ADT’srefersto AbstractionDataTypes. Basically, abstractionmeansprovidingthe relevant&
necessarydetailsbyhidingthe irrelevantdetails.
These are the Data types whichare createdby the user/programmer onitsownandare not present
instandard libraries. Itsspecificationdetailsare importantforusernotimplementationdetails.
While designingof ADT’stwothingsare important i.e., Specification&Implementation.
Specificationmeanswhatvaluesare presentinitsdomain&what operationscanbe performedon
valuesof that particulardatatype & Implementation referstohow these operationsare performed
and howthisdata type isrepresented.
User defineddatatypesare definedalongwiththeiroperations &to simplifythe processof solving
problems,we combine the datastructureswiththeiroperations &we call themAbstractData Types
(ADTs).
Soln 4.
Linear& Non-lineardatastructuresare classifiedunderNon-Primitive datastructures.
Linear Data Structure: It referstothe data structure whicharrangesor organise the dataitems or
elements inalinearfashionsothatall dataitemscan be traversedina single run.It neednotbe
linearorsequential inmemory.E.g. Arrays,Stacksetc.
Non-LinearData Structure: It referstothe data structure whicharrangesor organisesthe dataitems
or elementsinnon-linearorrandomfashion.Here,all dataitemscannotbe traversedina single run.
E.g Trees,graphsetc.
Soln 5.
Importance of Data Structures: Data Structure are logical or mathematical modelof particular
organisationof data.
1. Data structures organisesthe dataitemsina systematic& efficientmannersothattheycan
be accessedproperly/easilyandoperationsondataitemscan be carriedout effectively.
2. Data structuresorganisesthe dataitemsinsuch a way thatwastage of memorycan be
prevented&resultsinmore efficientprograms.

More Related Content

What's hot

Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
Dhaval Kaneria
 
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
 
Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic Programming
paramalways
 
Lecture 2 data structures and algorithms
Lecture 2 data structures and algorithmsLecture 2 data structures and algorithms
Lecture 2 data structures and algorithms
Aakash deep Singhal
 
Introduction to algorithn class 1
Introduction to algorithn class 1Introduction to algorithn class 1
Introduction to algorithn class 1
Kumar
 

What's hot (19)

01 Analysis of Algorithms: Introduction
01 Analysis of Algorithms: Introduction01 Analysis of Algorithms: Introduction
01 Analysis of Algorithms: Introduction
 
Daa presentation 97
Daa presentation 97Daa presentation 97
Daa presentation 97
 
Daa notes 2
Daa notes 2Daa notes 2
Daa notes 2
 
Daa unit 5
Daa unit 5Daa unit 5
Daa unit 5
 
Daa chapter 1
Daa chapter 1Daa chapter 1
Daa chapter 1
 
ALGORITHMS - SHORT NOTES
ALGORITHMS - SHORT NOTESALGORITHMS - SHORT NOTES
ALGORITHMS - SHORT NOTES
 
Design & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture NotesDesign & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture Notes
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
 
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
 
Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic Programming
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
 
Greedy Algoritham
Greedy AlgorithamGreedy Algoritham
Greedy Algoritham
 
Algorithmic problem solving
Algorithmic problem solvingAlgorithmic problem solving
Algorithmic problem solving
 
Lecture 2 data structures and algorithms
Lecture 2 data structures and algorithmsLecture 2 data structures and algorithms
Lecture 2 data structures and algorithms
 
Fundamental of Algorithms
Fundamental of Algorithms Fundamental of Algorithms
Fundamental of Algorithms
 
Introduction to algorithn class 1
Introduction to algorithn class 1Introduction to algorithn class 1
Introduction to algorithn class 1
 
Introduction to Algorithms Complexity Analysis
Introduction to Algorithms Complexity Analysis Introduction to Algorithms Complexity Analysis
Introduction to Algorithms Complexity Analysis
 
Algorithms lecture 3
Algorithms lecture 3Algorithms lecture 3
Algorithms lecture 3
 
Design and analysis of algorithms
Design and analysis of algorithmsDesign and analysis of algorithms
Design and analysis of algorithms
 

Similar to Data Structures and Algorithms

Cupdf.com introduction to-data-structures-and-algorithm
Cupdf.com introduction to-data-structures-and-algorithmCupdf.com introduction to-data-structures-and-algorithm
Cupdf.com introduction to-data-structures-and-algorithm
TarikuDabala1
 
2-Algorithms and Complexit data structurey.pdf
2-Algorithms and Complexit data structurey.pdf2-Algorithms and Complexit data structurey.pdf
2-Algorithms and Complexit data structurey.pdf
ishan743441
 
Performance analysis and randamized agoritham
Performance analysis and randamized agorithamPerformance analysis and randamized agoritham
Performance analysis and randamized agoritham
lilyMalar1
 

Similar to Data Structures and Algorithms (20)

INTRODUCTION TO ALGORITHM in MATHEMATICAL PROBLEM SOLVING
INTRODUCTION TO ALGORITHM in MATHEMATICAL PROBLEM SOLVINGINTRODUCTION TO ALGORITHM in MATHEMATICAL PROBLEM SOLVING
INTRODUCTION TO ALGORITHM in MATHEMATICAL PROBLEM SOLVING
 
Unit i basic concepts of algorithms
Unit i basic concepts of algorithmsUnit i basic concepts of algorithms
Unit i basic concepts of algorithms
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
 
Cupdf.com introduction to-data-structures-and-algorithm
Cupdf.com introduction to-data-structures-and-algorithmCupdf.com introduction to-data-structures-and-algorithm
Cupdf.com introduction to-data-structures-and-algorithm
 
Algorithm analysis and efficiency
Algorithm analysis and efficiencyAlgorithm analysis and efficiency
Algorithm analysis and efficiency
 
Unit 1, ADA.pptx
Unit 1, ADA.pptxUnit 1, ADA.pptx
Unit 1, ADA.pptx
 
Time Complexity Analysis in Data Structure.docx
Time Complexity Analysis in Data Structure.docxTime Complexity Analysis in Data Structure.docx
Time Complexity Analysis in Data Structure.docx
 
2-Algorithms and Complexit data structurey.pdf
2-Algorithms and Complexit data structurey.pdf2-Algorithms and Complexit data structurey.pdf
2-Algorithms and Complexit data structurey.pdf
 
Python algorithm
Python algorithmPython algorithm
Python algorithm
 
DSA Complexity.pptx What is Complexity Analysis? What is the need for Compl...
DSA Complexity.pptx   What is Complexity Analysis? What is the need for Compl...DSA Complexity.pptx   What is Complexity Analysis? What is the need for Compl...
DSA Complexity.pptx What is Complexity Analysis? What is the need for Compl...
 
2. Introduction to Algorithm.pptx
2. Introduction to Algorithm.pptx2. Introduction to Algorithm.pptx
2. Introduction to Algorithm.pptx
 
Data Abstraction (Chapter 1)
Data Abstraction (Chapter 1)Data Abstraction (Chapter 1)
Data Abstraction (Chapter 1)
 
Complexity of Algorithm
Complexity of AlgorithmComplexity of Algorithm
Complexity of Algorithm
 
Introduction to Algorithms Introduction to Algorithms.pptx
Introduction to Algorithms Introduction to Algorithms.pptxIntroduction to Algorithms Introduction to Algorithms.pptx
Introduction to Algorithms Introduction to Algorithms.pptx
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
Algorithm.pptx
Algorithm.pptxAlgorithm.pptx
Algorithm.pptx
 
Algorithm.pptx
Algorithm.pptxAlgorithm.pptx
Algorithm.pptx
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
 
Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdf
 
Performance analysis and randamized agoritham
Performance analysis and randamized agorithamPerformance analysis and randamized agoritham
Performance analysis and randamized agoritham
 

Recently uploaded

Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 

Recently uploaded (20)

Path loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelPath loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata Model
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor
 
Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To Curves
 
Databricks Generative AI Fundamentals .pdf
Databricks Generative AI Fundamentals  .pdfDatabricks Generative AI Fundamentals  .pdf
Databricks Generative AI Fundamentals .pdf
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
Passive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptPassive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.ppt
 
Introduction to Geographic Information Systems
Introduction to Geographic Information SystemsIntroduction to Geographic Information Systems
Introduction to Geographic Information Systems
 
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Compressing and Sparsifying LLM in GenAI Applications
Compressing and Sparsifying LLM in GenAI ApplicationsCompressing and Sparsifying LLM in GenAI Applications
Compressing and Sparsifying LLM in GenAI Applications
 
Danikor Product Catalog- Screw Feeder.pdf
Danikor Product Catalog- Screw Feeder.pdfDanikor Product Catalog- Screw Feeder.pdf
Danikor Product Catalog- Screw Feeder.pdf
 
fitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptfitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .ppt
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptx
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 

Data Structures and Algorithms

  • 1. Soln 1. "Algorithm"referstothe setof instructions (where eachinstructionhasitsclearand defined meaning) whichare intendedtosolve the problemwithfinite amountof effortinfinite periodof time. OR In otherwords,AlgorithmmeansStepstoSolve the Problem.The solutiontoeveryproblemhas stepsassociatedwithitthatare calledAlgorithms. The characteristicsof Algorithmsare: 1. It shouldalwaysbe of finite lengthandterminatesinfinite no.of stepsandwithinfinite time. 2. It shouldhave 0 or more inputs (takenfromuser) andprovides1or more outputs(inrelationto input). 3. The operationstobe performedneedstobe verybasicso that theycan be performedeasily& efficientlyand infinite length. 4. The outputor actionsperformedshouldnotbe vague orunclear. Soln 2. Time complexityandSpace complexityare the factorsor part of AlgorithmAnalysis. Algorithmanalysisisimportantinordertocheck whetherthe algorithmdesignedtosolve the problemisefficientornot,intermsof Space usedbyit inmemoryandits Runningtime asfunction of inputsize. We have bestcase (fastest),averagecase (prediction),worstcase (slowest)definedfor everyalgorithm. Time Complexityreferstostudyof time efficiencyof analgorithm asa functionof inputtoalgorithm (no.of inputs) OR Amountof time takenbythe algorithmto solve the problemasfunctionof input to the algorithm. The rate at whichfunctiongrowsasfunctionof input size iscalledGrowthof Function.Itcan be constant,linear,quadratic,cubicetc. Space Complexityreferstomemoryoccupiedorspace usedbyan algorithminthe mainmemory withrespecttoinputsor as a functionof input to the algorithm. We make use of AsymptoticNotationstocheckthe efficiencyof algorithm&we’ll alwaysprefer algorithmwhichtakeslessmemory(i.e.,wastage isless) andterminatesinfinite time. Soln 3. ADT’srefersto AbstractionDataTypes. Basically, abstractionmeansprovidingthe relevant& necessarydetailsbyhidingthe irrelevantdetails. These are the Data types whichare createdby the user/programmer onitsownandare not present instandard libraries. Itsspecificationdetailsare importantforusernotimplementationdetails. While designingof ADT’stwothingsare important i.e., Specification&Implementation. Specificationmeanswhatvaluesare presentinitsdomain&what operationscanbe performedon valuesof that particulardatatype & Implementation referstohow these operationsare performed and howthisdata type isrepresented.
  • 2. User defineddatatypesare definedalongwiththeiroperations &to simplifythe processof solving problems,we combine the datastructureswiththeiroperations &we call themAbstractData Types (ADTs). Soln 4. Linear& Non-lineardatastructuresare classifiedunderNon-Primitive datastructures. Linear Data Structure: It referstothe data structure whicharrangesor organise the dataitems or elements inalinearfashionsothatall dataitemscan be traversedina single run.It neednotbe linearorsequential inmemory.E.g. Arrays,Stacksetc. Non-LinearData Structure: It referstothe data structure whicharrangesor organisesthe dataitems or elementsinnon-linearorrandomfashion.Here,all dataitemscannotbe traversedina single run. E.g Trees,graphsetc. Soln 5. Importance of Data Structures: Data Structure are logical or mathematical modelof particular organisationof data. 1. Data structures organisesthe dataitemsina systematic& efficientmannersothattheycan be accessedproperly/easilyandoperationsondataitemscan be carriedout effectively. 2. Data structuresorganisesthe dataitemsinsuch a way thatwastage of memorycan be prevented&resultsinmore efficientprograms.