SlideShare ist ein Scribd-Unternehmen logo
1 von 50
Program By :- Eman El-ma’asarawi 2/24/2011 1
What is Program? How to make program? How to think about the program? Steps for making a good project. 2/24/2011 2
2/24/2011 3
DS Algorithm Program +  = 2/24/2011 4
 list of instruction to achieve specific task. Program I/P instruction Processing instruction O/P instruction 2/24/2011 5
Programming Toolboxes H/W S/W Os Compiler  Text editor  Idea ware Algorithm DS Programming Methodologies Structure Design Oop  S/W Concepts Information hiding Data encapsulation Data abstraction 2/24/2011 6
Algorithm DS Methodologies Application (text editor) Compiler  OS HW 2/24/2011 7
        DS (Data Structure) Data :- factual information  Structure :- Arrangement or relationship of elements as particles Data structure :-A means of storing a collection of data 2/24/2011 8
DS cont
 A data structure can be viewed as consisting of a set of algorithms for performing operations on the data it stores. 2/24/2011 9
Variable:- 			data storage location that has a value that can change during program execution.  Constant:- 		fixed value that can’t change. 2/24/2011 10
Applications of Data Structure DS Linear Non-Linear Sequential Linked Linked queues Graphs Tree Linked stacks linked lists queue array stack 2/24/2011 11
1-Array 2-Linked List 3-Stack 4-Queue 5-Tree 2/24/2011 12
1-Array  Is a data structure where all elements are stored in contiguous memory n 2 1 0 Individual elements Array  2/24/2011 13
Random access Fixed size Less efficient used on data stored in array Array properties Array size Element size 1-in bytes 2-the number of element Data type of array 2/24/2011 14
Exambel 0 1 2 3 4 5 6 7   1      2     34     56      2     78      0     10 2/24/2011 15
2-linked list Is a data structure in which the first element is  (head) stored on its own Data List head / Dummy Node Null 2/24/2011 16
Linked list properties The size not fixed grow/shrink The extra space is needed to store the pointer of each element  More time Implement linked list use array but not efficient Complex to code and manage 2/24/2011 17
Appending Node 		add Node to the end of the list. Traversing 		check the linked list. Inserting Node 		add Node in the middle of a list. Deleting Node from memory 			 Modified links Destroy Operation on linked list 2/24/2011 18
Which is fast array or linked list? Why? 2/24/2011 19
Is a data structure consisting of data nodes connected to each other with pointers. Each node connected to 2 or more other nodes. 2/24/2011 20 			5-Trees
The order of the tree:- 		is the max number of nodes to which any single node connected.  binary tree:- 		is the simplest tree is of order 2. 	each child have two pointers. Root node:- 		the topmost node in the tree.  leaf node:- 	node with no children. 2/24/2011 21 Tree properties
Data right left Data right left Data right left 2/24/2011 22
Create binary tree Inserting Node Traversing the tree recursion Searching the tree Deleting the tree 2/24/2011 23 Binary search tree op

Logical sequence of steps describe complete solution to solve problem in finite amount of time May involve alternation, iteration or recursion More than one algorithm possible for the same task Algorithms 2/24/2011 24
Sorting 				Searching -Insertion sort 			-linear search -Merge sort			-Binary search	 -Heap sort -Quick sort 2/24/2011 25 Algorithmes
What resources are required to accomplish the task  How one algorithm compares with other algorithms  How much time or space is required  Measured in terms of common basic operations Efficiency of Algorithms 2/24/2011 26
Worst-case: (usually)            T(n) = maximum time of algorithm on any input of size n. Average-case: (sometimes) T(n) = expected time of algorithm over all inputs of size n. Need assumption of statistical distribution of inputs. Best-case: (bogus)              Cheat with a slow algorithm that works fast on some input. 2/24/2011 27 Kinds of analyses
Running time:  On a particular input, it is the number of primitive operations (steps) executed.  One line may take a different amount of time than another, but each execution of line i takes the same amount of time c . Running time of the algorithm is 	Æ© (cost of statement)*(number of times statement is executed) 2/24/2011 28
How efficiency varies with the size of the task  E.g. if the size of the task increases linearly, do the efficiency measures increase linearly, quadratically, exponentially,...?  Expressed in terms of standard functions of n Complexity 2/24/2011 29
notations Big o Big Ɵ Big ℩ 	F(n)=g(n) C1g(n)<=f(n)<=c2g(n) F(n)<=g(n) F(n)>=g(n) Data shape Ex - insertion sort best case Data method Ex – insertion sort worst case 2/24/2011 30
PseudoCodeconventions Indentation indicates block structure. While, for, repeat , if , then, and else. â–čindicates comment. indicates assignment. Variables are local by default. Array elements accessed as in A[i]. 2/24/2011 31
Calculate x^n, where n is an integer greater than 0. Algorithm 1. Set r = 1 2. Set i = 1 3. Repeat 	3.1 If i=n then terminate loop 	3.2 Multiply r by x 	3.3 Add 1 to i 4. Exit with result r ExampleSimple Power Algorithm 2/24/2011 32
O(n) - the algorithm requires n multiplications. Time complexity 2/24/2011 33
Formulate a Concise Specification of the Problem Design a high-level strategy for a solution Refine steps 1 and 2 if necessary Complete the details of the design Implement in the chosen language How to Approach Recursive Algorithms 2/24/2011 34
Calculate x^n, where n is an integer greater than 0.  Recursive Algorithm 1. If n=0 then  1.1 set r = 1  2. Else  2.1 set p = n/2 (dropping any remainder)  2.2 set r = (xp)2  2.3 if n is odd then  2.3.1 multiply r by x  3. Exit with result r Recursive Power Algorithm 2/24/2011 35
static int power (int x, int n) { 	int r; 	if (n == 0) 		r = 1; 	else { 		r = power(x,n/2); 		r = r*r; 		if (n%2 != 0) 			r *= x; 	} 	return r; } 2/24/2011 36 implementation
O(log n) - the algorithm requires approximately log   n multiplications. 2 Time complexity 2/24/2011 37
2/24/2011 38
Quiz Towers of Hanoi 1 2 3 2/24/2011 39
1 2 3 2/24/2011 40
1 2 3 2/24/2011 41
1 2 3 2/24/2011 42
1 2 3 2/24/2011 43
1 2 3 2/24/2011 44
1 2 3 2/24/2011 45
1 2 3 2/24/2011 46
Solution' ≡ shortest path  Recursive Solution: 1. Identify biggest discrepancy (=disk N)  2. If moveable to goal peg Then move       Else 3.   Subgoal: set-up (N−1)-disk tower on non-goal peg.  4. Go to 1.  ... 2/24/2011 47
2/24/2011 48
SDLC (s/w Development life cycle) Design Problem analysis Maintenance  Testing Requirement definitions Implementation  Using program  Delivery 2/24/2011 49
The End 2/24/2011 50

Weitere Àhnliche Inhalte

Was ist angesagt?

Merging files (Data Structure)
Merging files (Data Structure)Merging files (Data Structure)
Merging files (Data Structure)Tech_MX
 
Anything but simple Mathematica
Anything but simple MathematicaAnything but simple Mathematica
Anything but simple MathematicaSergeiPronkevich
 
Introduction to simulink (1)
Introduction to simulink (1)Introduction to simulink (1)
Introduction to simulink (1)Memo Love
 
Basic matlab and matrix
Basic matlab and matrixBasic matlab and matrix
Basic matlab and matrixSaidur Rahman
 
Basic operators in matlab
Basic operators in matlabBasic operators in matlab
Basic operators in matlabrishiteta
 
AITC: White Paper on Distributed Level Of Permission Hierarchy
AITC: White Paper on Distributed Level Of Permission HierarchyAITC: White Paper on Distributed Level Of Permission Hierarchy
AITC: White Paper on Distributed Level Of Permission HierarchyRajesh Kumar
 
Data structure
Data structureData structure
Data structureGaurav Handge
 
Forelasning4
Forelasning4Forelasning4
Forelasning4Memo Love
 
Introductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, QueueIntroductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, QueueGhaffar Khan
 
Programming Logic and Design: Working with Data
Programming Logic and Design: Working with DataProgramming Logic and Design: Working with Data
Programming Logic and Design: Working with DataNicole Ryan
 
Array sorting
Array sortingArray sorting
Array sortingALI RAZA
 
Introduction to MATLAB 1
Introduction to MATLAB 1Introduction to MATLAB 1
Introduction to MATLAB 1Mohamed Gafar
 
C Programming : Pointers and Arrays, Pointers and Strings
C Programming : Pointers and Arrays, Pointers and StringsC Programming : Pointers and Arrays, Pointers and Strings
C Programming : Pointers and Arrays, Pointers and StringsSelvaraj Seerangan
 

Was ist angesagt? (17)

Merging files (Data Structure)
Merging files (Data Structure)Merging files (Data Structure)
Merging files (Data Structure)
 
Anything but simple Mathematica
Anything but simple MathematicaAnything but simple Mathematica
Anything but simple Mathematica
 
Introduction to simulink (1)
Introduction to simulink (1)Introduction to simulink (1)
Introduction to simulink (1)
 
02. the linked lists (1)
02. the linked lists (1)02. the linked lists (1)
02. the linked lists (1)
 
Basic matlab and matrix
Basic matlab and matrixBasic matlab and matrix
Basic matlab and matrix
 
Storage struct
Storage structStorage struct
Storage struct
 
Basic operators in matlab
Basic operators in matlabBasic operators in matlab
Basic operators in matlab
 
AITC: White Paper on Distributed Level Of Permission Hierarchy
AITC: White Paper on Distributed Level Of Permission HierarchyAITC: White Paper on Distributed Level Of Permission Hierarchy
AITC: White Paper on Distributed Level Of Permission Hierarchy
 
Project Report
Project ReportProject Report
Project Report
 
Data structure
Data structureData structure
Data structure
 
Forelasning4
Forelasning4Forelasning4
Forelasning4
 
Matlab anilkumar
Matlab  anilkumarMatlab  anilkumar
Matlab anilkumar
 
Introductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, QueueIntroductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, Queue
 
Programming Logic and Design: Working with Data
Programming Logic and Design: Working with DataProgramming Logic and Design: Working with Data
Programming Logic and Design: Working with Data
 
Array sorting
Array sortingArray sorting
Array sorting
 
Introduction to MATLAB 1
Introduction to MATLAB 1Introduction to MATLAB 1
Introduction to MATLAB 1
 
C Programming : Pointers and Arrays, Pointers and Strings
C Programming : Pointers and Arrays, Pointers and StringsC Programming : Pointers and Arrays, Pointers and Strings
C Programming : Pointers and Arrays, Pointers and Strings
 

Andere mochten auch

Liquid Day - Microservicios y contenedores
Liquid Day - Microservicios y contenedoresLiquid Day - Microservicios y contenedores
Liquid Day - Microservicios y contenedoresSoftware Guru
 
Atividade de sistemas operacionais
Atividade de sistemas operacionaisAtividade de sistemas operacionais
Atividade de sistemas operacionaismorgannaprata
 
Usa el correo electrĂłnico
Usa el correo electrĂłnicoUsa el correo electrĂłnico
Usa el correo electrĂłnicoportalsenior
 
Competitive winning strategy
Competitive winning strategyCompetitive winning strategy
Competitive winning strategyvchintawar
 
Hay Esquistosomiasis
Hay EsquistosomiasisHay Esquistosomiasis
Hay EsquistosomiasisRene Diana
 
60 Hz Flygt N-Pump Series Brochure
60 Hz Flygt N-Pump Series Brochure60 Hz Flygt N-Pump Series Brochure
60 Hz Flygt N-Pump Series BrochureRica Baudin
 
Sintesis informativa 07 05 2015
Sintesis informativa 07 05 2015Sintesis informativa 07 05 2015
Sintesis informativa 07 05 2015megaradioexpress
 
Dil Nasil Ă¶ÄŸRenilir
Dil Nasil Ă¶ÄŸRenilirDil Nasil Ă¶ÄŸRenilir
Dil Nasil Ă¶ÄŸReniliritu
 
Info aula 00 - conceito de internet
Info   aula 00 - conceito de internetInfo   aula 00 - conceito de internet
Info aula 00 - conceito de internetBĂĄrbara Cerqueira
 
La TecnologĂ­A Mmm
La  TecnologĂ­A MmmLa  TecnologĂ­A Mmm
La TecnologĂ­A Mmmleidy johanna
 
LecciĂłn 10 problemas dinĂĄmicos
LecciĂłn 10 problemas dinĂĄmicosLecciĂłn 10 problemas dinĂĄmicos
LecciĂłn 10 problemas dinĂĄmicosMartha Martinez
 
Sistemas biolĂłgicos
Sistemas  biolĂłgicosSistemas  biolĂłgicos
Sistemas biolĂłgicosGiuliana Tinoco
 

Andere mochten auch (20)

Bibliografia geral
Bibliografia geralBibliografia geral
Bibliografia geral
 
Liquid Day - Microservicios y contenedores
Liquid Day - Microservicios y contenedoresLiquid Day - Microservicios y contenedores
Liquid Day - Microservicios y contenedores
 
Atividade de sistemas operacionais
Atividade de sistemas operacionaisAtividade de sistemas operacionais
Atividade de sistemas operacionais
 
PrĂĄcticas tema agricultura
PrĂĄcticas tema agriculturaPrĂĄcticas tema agricultura
PrĂĄcticas tema agricultura
 
Usa el correo electrĂłnico
Usa el correo electrĂłnicoUsa el correo electrĂłnico
Usa el correo electrĂłnico
 
Botas fujiwara
Botas fujiwaraBotas fujiwara
Botas fujiwara
 
Competitive winning strategy
Competitive winning strategyCompetitive winning strategy
Competitive winning strategy
 
Homai Vyarawala
Homai VyarawalaHomai Vyarawala
Homai Vyarawala
 
Hay Esquistosomiasis
Hay EsquistosomiasisHay Esquistosomiasis
Hay Esquistosomiasis
 
60 Hz Flygt N-Pump Series Brochure
60 Hz Flygt N-Pump Series Brochure60 Hz Flygt N-Pump Series Brochure
60 Hz Flygt N-Pump Series Brochure
 
Sintesis informativa 07 05 2015
Sintesis informativa 07 05 2015Sintesis informativa 07 05 2015
Sintesis informativa 07 05 2015
 
Cisa cpe-spanish
Cisa cpe-spanishCisa cpe-spanish
Cisa cpe-spanish
 
Dil Nasil Ă¶ÄŸRenilir
Dil Nasil Ă¶ÄŸRenilirDil Nasil Ă¶ÄŸRenilir
Dil Nasil Ă¶ÄŸRenilir
 
Informe de lectura. met
Informe de lectura. metInforme de lectura. met
Informe de lectura. met
 
Gmail.com
Gmail.comGmail.com
Gmail.com
 
Info aula 00 - conceito de internet
Info   aula 00 - conceito de internetInfo   aula 00 - conceito de internet
Info aula 00 - conceito de internet
 
La TecnologĂ­A Mmm
La  TecnologĂ­A MmmLa  TecnologĂ­A Mmm
La TecnologĂ­A Mmm
 
LecciĂłn 10 problemas dinĂĄmicos
LecciĂłn 10 problemas dinĂĄmicosLecciĂłn 10 problemas dinĂĄmicos
LecciĂłn 10 problemas dinĂĄmicos
 
P1 s3 d1 baja
P1 s3 d1 bajaP1 s3 d1 baja
P1 s3 d1 baja
 
Sistemas biolĂłgicos
Sistemas  biolĂłgicosSistemas  biolĂłgicos
Sistemas biolĂłgicos
 

Ähnlich wie Program and Algorithm Fundamentals

Introduction to data structures and complexity.pptx
Introduction to data structures and complexity.pptxIntroduction to data structures and complexity.pptx
Introduction to data structures and complexity.pptxPJS KUMAR
 
Data Structure and Algorithm chapter two, This material is for Data Structure...
Data Structure and Algorithm chapter two, This material is for Data Structure...Data Structure and Algorithm chapter two, This material is for Data Structure...
Data Structure and Algorithm chapter two, This material is for Data Structure...bekidea
 
Chapter 2 ds
Chapter 2 dsChapter 2 ds
Chapter 2 dsHanif Durad
 
Scala and Deep Learning
Scala and Deep LearningScala and Deep Learning
Scala and Deep LearningOswald Campesato
 
CS3114_09212011.ppt
CS3114_09212011.pptCS3114_09212011.ppt
CS3114_09212011.pptArumugam90
 
Deep Learning: R with Keras and TensorFlow
Deep Learning: R with Keras and TensorFlowDeep Learning: R with Keras and TensorFlow
Deep Learning: R with Keras and TensorFlowOswald Campesato
 
C++ and Deep Learning
C++ and Deep LearningC++ and Deep Learning
C++ and Deep LearningOswald Campesato
 
Data Structures unit I Introduction - data types
Data Structures unit I Introduction - data typesData Structures unit I Introduction - data types
Data Structures unit I Introduction - data typesAmirthaVarshini80
 
Introduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptxIntroduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptxline24arts
 
Towards an Incremental Schema-level Index for Distributed Linked Open Data G...
Towards an Incremental Schema-level Index  for Distributed Linked Open Data G...Towards an Incremental Schema-level Index  for Distributed Linked Open Data G...
Towards an Incremental Schema-level Index for Distributed Linked Open Data G...Till Blume
 
Data Structures and Algorithm Analysis
Data Structures  and  Algorithm AnalysisData Structures  and  Algorithm Analysis
Data Structures and Algorithm AnalysisMary Margarat
 
cyber_systems.pdf
cyber_systems.pdfcyber_systems.pdf
cyber_systems.pdfJiananWang21
 
Problem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study materialProblem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study materialTo Sum It Up
 
Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...
Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...
Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...DrkhanchanaR
 
DATA STRUCTURE.pdf
DATA STRUCTURE.pdfDATA STRUCTURE.pdf
DATA STRUCTURE.pdfibrahim386946
 
DATA STRUCTURE
DATA STRUCTUREDATA STRUCTURE
DATA STRUCTURERobinRohit2
 
Workshop nwav 47 - LVS - Tool for Quantitative Data Analysis
Workshop nwav 47 - LVS - Tool for Quantitative Data AnalysisWorkshop nwav 47 - LVS - Tool for Quantitative Data Analysis
Workshop nwav 47 - LVS - Tool for Quantitative Data AnalysisOlga Scrivner
 

Ähnlich wie Program and Algorithm Fundamentals (20)

Introduction to data structures and complexity.pptx
Introduction to data structures and complexity.pptxIntroduction to data structures and complexity.pptx
Introduction to data structures and complexity.pptx
 
Data structures
Data structuresData structures
Data structures
 
Data Structure and Algorithm chapter two, This material is for Data Structure...
Data Structure and Algorithm chapter two, This material is for Data Structure...Data Structure and Algorithm chapter two, This material is for Data Structure...
Data Structure and Algorithm chapter two, This material is for Data Structure...
 
Chapter 2 ds
Chapter 2 dsChapter 2 ds
Chapter 2 ds
 
Scala and Deep Learning
Scala and Deep LearningScala and Deep Learning
Scala and Deep Learning
 
Lec1
Lec1Lec1
Lec1
 
CS3114_09212011.ppt
CS3114_09212011.pptCS3114_09212011.ppt
CS3114_09212011.ppt
 
Deep Learning: R with Keras and TensorFlow
Deep Learning: R with Keras and TensorFlowDeep Learning: R with Keras and TensorFlow
Deep Learning: R with Keras and TensorFlow
 
C++ and Deep Learning
C++ and Deep LearningC++ and Deep Learning
C++ and Deep Learning
 
Data Structures unit I Introduction - data types
Data Structures unit I Introduction - data typesData Structures unit I Introduction - data types
Data Structures unit I Introduction - data types
 
Introduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptxIntroduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptx
 
Towards an Incremental Schema-level Index for Distributed Linked Open Data G...
Towards an Incremental Schema-level Index  for Distributed Linked Open Data G...Towards an Incremental Schema-level Index  for Distributed Linked Open Data G...
Towards an Incremental Schema-level Index for Distributed Linked Open Data G...
 
Data Structures and Algorithm Analysis
Data Structures  and  Algorithm AnalysisData Structures  and  Algorithm Analysis
Data Structures and Algorithm Analysis
 
cyber_systems.pdf
cyber_systems.pdfcyber_systems.pdf
cyber_systems.pdf
 
Lect1.pptx
Lect1.pptxLect1.pptx
Lect1.pptx
 
Problem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study materialProblem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study material
 
Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...
Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...
Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...
 
DATA STRUCTURE.pdf
DATA STRUCTURE.pdfDATA STRUCTURE.pdf
DATA STRUCTURE.pdf
 
DATA STRUCTURE
DATA STRUCTUREDATA STRUCTURE
DATA STRUCTURE
 
Workshop nwav 47 - LVS - Tool for Quantitative Data Analysis
Workshop nwav 47 - LVS - Tool for Quantitative Data AnalysisWorkshop nwav 47 - LVS - Tool for Quantitative Data Analysis
Workshop nwav 47 - LVS - Tool for Quantitative Data Analysis
 

Mehr von DevMix

Framework prototype
Framework prototypeFramework prototype
Framework prototypeDevMix
 
Framework prototype
Framework prototypeFramework prototype
Framework prototypeDevMix
 
Devmix algorithm
Devmix algorithmDevmix algorithm
Devmix algorithmDevMix
 
Select your career
Select your careerSelect your career
Select your careerDevMix
 
Devmix algorithm
Devmix algorithmDevmix algorithm
Devmix algorithmDevMix
 
Framework prototype
Framework prototypeFramework prototype
Framework prototypeDevMix
 
New in html5
New in html5New in html5
New in html5DevMix
 
Intro To DataBase
Intro To DataBaseIntro To DataBase
Intro To DataBaseDevMix
 
Intro to windows app
Intro to windows appIntro to windows app
Intro to windows appDevMix
 
OOP in C#
OOP in C#OOP in C#
OOP in C#DevMix
 
Logos samples
Logos samplesLogos samples
Logos samplesDevMix
 
C sharp fundamentals Part I
C sharp fundamentals Part IC sharp fundamentals Part I
C sharp fundamentals Part IDevMix
 
Python
PythonPython
PythonDevMix
 
Making a presentation
Making a presentationMaking a presentation
Making a presentationDevMix
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud ComputingDevMix
 

Mehr von DevMix (15)

Framework prototype
Framework prototypeFramework prototype
Framework prototype
 
Framework prototype
Framework prototypeFramework prototype
Framework prototype
 
Devmix algorithm
Devmix algorithmDevmix algorithm
Devmix algorithm
 
Select your career
Select your careerSelect your career
Select your career
 
Devmix algorithm
Devmix algorithmDevmix algorithm
Devmix algorithm
 
Framework prototype
Framework prototypeFramework prototype
Framework prototype
 
New in html5
New in html5New in html5
New in html5
 
Intro To DataBase
Intro To DataBaseIntro To DataBase
Intro To DataBase
 
Intro to windows app
Intro to windows appIntro to windows app
Intro to windows app
 
OOP in C#
OOP in C#OOP in C#
OOP in C#
 
Logos samples
Logos samplesLogos samples
Logos samples
 
C sharp fundamentals Part I
C sharp fundamentals Part IC sharp fundamentals Part I
C sharp fundamentals Part I
 
Python
PythonPython
Python
 
Making a presentation
Making a presentationMaking a presentation
Making a presentation
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 

KĂŒrzlich hochgeladen

APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 

KĂŒrzlich hochgeladen (20)

APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 

Program and Algorithm Fundamentals

  • 1. Program By :- Eman El-ma’asarawi 2/24/2011 1
  • 2. What is Program? How to make program? How to think about the program? Steps for making a good project. 2/24/2011 2
  • 4. DS Algorithm Program + = 2/24/2011 4
  • 5. list of instruction to achieve specific task. Program I/P instruction Processing instruction O/P instruction 2/24/2011 5
  • 6. Programming Toolboxes H/W S/W Os Compiler Text editor Idea ware Algorithm DS Programming Methodologies Structure Design Oop S/W Concepts Information hiding Data encapsulation Data abstraction 2/24/2011 6
  • 7. Algorithm DS Methodologies Application (text editor) Compiler OS HW 2/24/2011 7
  • 8. DS (Data Structure) Data :- factual information Structure :- Arrangement or relationship of elements as particles Data structure :-A means of storing a collection of data 2/24/2011 8
  • 9. DS cont
 A data structure can be viewed as consisting of a set of algorithms for performing operations on the data it stores. 2/24/2011 9
  • 10. Variable:- data storage location that has a value that can change during program execution. Constant:- fixed value that can’t change. 2/24/2011 10
  • 11. Applications of Data Structure DS Linear Non-Linear Sequential Linked Linked queues Graphs Tree Linked stacks linked lists queue array stack 2/24/2011 11
  • 12. 1-Array 2-Linked List 3-Stack 4-Queue 5-Tree 2/24/2011 12
  • 13. 1-Array Is a data structure where all elements are stored in contiguous memory n 2 1 0 Individual elements Array 2/24/2011 13
  • 14. Random access Fixed size Less efficient used on data stored in array Array properties Array size Element size 1-in bytes 2-the number of element Data type of array 2/24/2011 14
  • 15. Exambel 0 1 2 3 4 5 6 7 1 2 34 56 2 78 0 10 2/24/2011 15
  • 16. 2-linked list Is a data structure in which the first element is (head) stored on its own Data List head / Dummy Node Null 2/24/2011 16
  • 17. Linked list properties The size not fixed grow/shrink The extra space is needed to store the pointer of each element More time Implement linked list use array but not efficient Complex to code and manage 2/24/2011 17
  • 18. Appending Node add Node to the end of the list. Traversing check the linked list. Inserting Node add Node in the middle of a list. Deleting Node from memory Modified links Destroy Operation on linked list 2/24/2011 18
  • 19. Which is fast array or linked list? Why? 2/24/2011 19
  • 20. Is a data structure consisting of data nodes connected to each other with pointers. Each node connected to 2 or more other nodes. 2/24/2011 20 5-Trees
  • 21. The order of the tree:- is the max number of nodes to which any single node connected. binary tree:- is the simplest tree is of order 2. each child have two pointers. Root node:- the topmost node in the tree. leaf node:- node with no children. 2/24/2011 21 Tree properties
  • 22. Data right left Data right left Data right left 2/24/2011 22
  • 23. Create binary tree Inserting Node Traversing the tree recursion Searching the tree Deleting the tree 2/24/2011 23 Binary search tree op

  • 24. Logical sequence of steps describe complete solution to solve problem in finite amount of time May involve alternation, iteration or recursion More than one algorithm possible for the same task Algorithms 2/24/2011 24
  • 25. Sorting Searching -Insertion sort -linear search -Merge sort -Binary search -Heap sort -Quick sort 2/24/2011 25 Algorithmes
  • 26. What resources are required to accomplish the task How one algorithm compares with other algorithms How much time or space is required Measured in terms of common basic operations Efficiency of Algorithms 2/24/2011 26
  • 27. Worst-case: (usually) T(n) = maximum time of algorithm on any input of size n. Average-case: (sometimes) T(n) = expected time of algorithm over all inputs of size n. Need assumption of statistical distribution of inputs. Best-case: (bogus) Cheat with a slow algorithm that works fast on some input. 2/24/2011 27 Kinds of analyses
  • 28. Running time: On a particular input, it is the number of primitive operations (steps) executed. One line may take a different amount of time than another, but each execution of line i takes the same amount of time c . Running time of the algorithm is Æ© (cost of statement)*(number of times statement is executed) 2/24/2011 28
  • 29. How efficiency varies with the size of the task E.g. if the size of the task increases linearly, do the efficiency measures increase linearly, quadratically, exponentially,...? Expressed in terms of standard functions of n Complexity 2/24/2011 29
  • 30. notations Big o Big Ɵ Big ℩ F(n)=g(n) C1g(n)<=f(n)<=c2g(n) F(n)<=g(n) F(n)>=g(n) Data shape Ex - insertion sort best case Data method Ex – insertion sort worst case 2/24/2011 30
  • 31. PseudoCodeconventions Indentation indicates block structure. While, for, repeat , if , then, and else. â–čindicates comment. indicates assignment. Variables are local by default. Array elements accessed as in A[i]. 2/24/2011 31
  • 32. Calculate x^n, where n is an integer greater than 0. Algorithm 1. Set r = 1 2. Set i = 1 3. Repeat 3.1 If i=n then terminate loop 3.2 Multiply r by x 3.3 Add 1 to i 4. Exit with result r ExampleSimple Power Algorithm 2/24/2011 32
  • 33. O(n) - the algorithm requires n multiplications. Time complexity 2/24/2011 33
  • 34. Formulate a Concise Specification of the Problem Design a high-level strategy for a solution Refine steps 1 and 2 if necessary Complete the details of the design Implement in the chosen language How to Approach Recursive Algorithms 2/24/2011 34
  • 35. Calculate x^n, where n is an integer greater than 0. Recursive Algorithm 1. If n=0 then 1.1 set r = 1 2. Else 2.1 set p = n/2 (dropping any remainder) 2.2 set r = (xp)2 2.3 if n is odd then 2.3.1 multiply r by x 3. Exit with result r Recursive Power Algorithm 2/24/2011 35
  • 36. static int power (int x, int n) { int r; if (n == 0) r = 1; else { r = power(x,n/2); r = r*r; if (n%2 != 0) r *= x; } return r; } 2/24/2011 36 implementation
  • 37. O(log n) - the algorithm requires approximately log n multiplications. 2 Time complexity 2/24/2011 37
  • 39. Quiz Towers of Hanoi 1 2 3 2/24/2011 39
  • 40. 1 2 3 2/24/2011 40
  • 41. 1 2 3 2/24/2011 41
  • 42. 1 2 3 2/24/2011 42
  • 43. 1 2 3 2/24/2011 43
  • 44. 1 2 3 2/24/2011 44
  • 45. 1 2 3 2/24/2011 45
  • 46. 1 2 3 2/24/2011 46
  • 47. Solution' ≡ shortest path Recursive Solution: 1. Identify biggest discrepancy (=disk N) 2. If moveable to goal peg Then move Else 3. Subgoal: set-up (N−1)-disk tower on non-goal peg. 4. Go to 1. ... 2/24/2011 47
  • 49. SDLC (s/w Development life cycle) Design Problem analysis Maintenance Testing Requirement definitions Implementation Using program Delivery 2/24/2011 49