SlideShare a Scribd company logo
CHAPTER 2 Mathematics for Algorithms
Example 2.2.6 Factorial  This algorithm computes the factorial of  n . factorial ( n ) { i  = 1 fact  = 1 while ( i  <  n ) { i  =  i  + 1 fact  =  fact  *  i } return  fact }
Example 2.3.1 Finding the Maximum Value in an Array Using a While Loop This algorithm finds the largest number in the array  s [1],  s [2], ... ,  s [ n ]. Input Parameter:  s Output Parameters: None array_max_ver1 ( s ) { large  =  s [1] i  = 2 while ( i  ≤  s . last ) { if ( s [ i ] >  large ) // larger value found large  =  s [ i ] i  =  i  + 1 } return  large }
Example 2.4.3 example ( n ) { if ( n  == 1) return for  i  = 1 to  n x  =  x  + 1 example( n /2) }

More Related Content

What's hot

Top schools in gudgao
Top schools in gudgaoTop schools in gudgao
Top schools in gudgao
Edhole.com
 
Hyper loglog
Hyper loglogHyper loglog
Hyper loglog
nybon
 
Proof of O(log *n) time complexity of Union find (Presentation by Wei Li, Zeh...
Proof of O(log *n) time complexity of Union find (Presentation by Wei Li, Zeh...Proof of O(log *n) time complexity of Union find (Presentation by Wei Li, Zeh...
Proof of O(log *n) time complexity of Union find (Presentation by Wei Li, Zeh...
Amrinder Arora
 
laws of exponents
laws of exponentslaws of exponents
laws of exponents
Rockey Sammy
 
Post_Number Systems_7
Post_Number Systems_7Post_Number Systems_7
Post_Number Systems_7
Marc King
 
ThreeTen
ThreeTenThreeTen
ThreeTen
彥彬 洪
 
Data structure
Data structureData structure
Data structure
kavitha muneeshwaran
 
Binary search in data structure
Binary search in data structureBinary search in data structure
Binary search in data structure
Meherul1234
 
Kmeans
KmeansKmeans
Kmeans
Nikita Goyal
 
Units Dimentions Error QA 2
Units Dimentions Error QA 2Units Dimentions Error QA 2
Units Dimentions Error QA 2
Lakshmikanta Satapathy
 
2-Rainbow Domination of Hexagonal Mesh Networks
2-Rainbow Domination of Hexagonal Mesh Networks2-Rainbow Domination of Hexagonal Mesh Networks
2-Rainbow Domination of Hexagonal Mesh Networks
ijcoa
 
Set Theory QA 3
Set Theory QA 3Set Theory QA 3
Set Theory QA 3
Lakshmikanta Satapathy
 
Maximum Likelihood Calibration of the Hercules Data Set
Maximum Likelihood Calibration of the Hercules Data SetMaximum Likelihood Calibration of the Hercules Data Set
Maximum Likelihood Calibration of the Hercules Data Set
Christopher Garling
 
Aplicaciones de la derivada
Aplicaciones de la derivadaAplicaciones de la derivada
Aplicaciones de la derivada
JOELSEBASTIANANDRADE
 
Data structure lecture 4
Data structure lecture 4Data structure lecture 4
Data structure lecture 4
Kumar
 
Aplicaciones de la derivada
Aplicaciones de la derivadaAplicaciones de la derivada
Aplicaciones de la derivada
JOELSEBASTIANANDRADE
 
K mean-clustering algorithm
K mean-clustering algorithmK mean-clustering algorithm
K mean-clustering algorithm
parry prabhu
 
Savulionienė, Loreta ; Sakalauskas, Leonidas „Modifikuoto stochastinio dažnų ...
Savulionienė, Loreta ; Sakalauskas, Leonidas „Modifikuoto stochastinio dažnų ...Savulionienė, Loreta ; Sakalauskas, Leonidas „Modifikuoto stochastinio dažnų ...
Savulionienė, Loreta ; Sakalauskas, Leonidas „Modifikuoto stochastinio dažnų ...
Lietuvos kompiuterininkų sąjunga
 
Cluster analysis using k-means method in R
Cluster analysis using k-means method in RCluster analysis using k-means method in R
Cluster analysis using k-means method in R
Vladimir Bakhrushin
 

What's hot (19)

Top schools in gudgao
Top schools in gudgaoTop schools in gudgao
Top schools in gudgao
 
Hyper loglog
Hyper loglogHyper loglog
Hyper loglog
 
Proof of O(log *n) time complexity of Union find (Presentation by Wei Li, Zeh...
Proof of O(log *n) time complexity of Union find (Presentation by Wei Li, Zeh...Proof of O(log *n) time complexity of Union find (Presentation by Wei Li, Zeh...
Proof of O(log *n) time complexity of Union find (Presentation by Wei Li, Zeh...
 
laws of exponents
laws of exponentslaws of exponents
laws of exponents
 
Post_Number Systems_7
Post_Number Systems_7Post_Number Systems_7
Post_Number Systems_7
 
ThreeTen
ThreeTenThreeTen
ThreeTen
 
Data structure
Data structureData structure
Data structure
 
Binary search in data structure
Binary search in data structureBinary search in data structure
Binary search in data structure
 
Kmeans
KmeansKmeans
Kmeans
 
Units Dimentions Error QA 2
Units Dimentions Error QA 2Units Dimentions Error QA 2
Units Dimentions Error QA 2
 
2-Rainbow Domination of Hexagonal Mesh Networks
2-Rainbow Domination of Hexagonal Mesh Networks2-Rainbow Domination of Hexagonal Mesh Networks
2-Rainbow Domination of Hexagonal Mesh Networks
 
Set Theory QA 3
Set Theory QA 3Set Theory QA 3
Set Theory QA 3
 
Maximum Likelihood Calibration of the Hercules Data Set
Maximum Likelihood Calibration of the Hercules Data SetMaximum Likelihood Calibration of the Hercules Data Set
Maximum Likelihood Calibration of the Hercules Data Set
 
Aplicaciones de la derivada
Aplicaciones de la derivadaAplicaciones de la derivada
Aplicaciones de la derivada
 
Data structure lecture 4
Data structure lecture 4Data structure lecture 4
Data structure lecture 4
 
Aplicaciones de la derivada
Aplicaciones de la derivadaAplicaciones de la derivada
Aplicaciones de la derivada
 
K mean-clustering algorithm
K mean-clustering algorithmK mean-clustering algorithm
K mean-clustering algorithm
 
Savulionienė, Loreta ; Sakalauskas, Leonidas „Modifikuoto stochastinio dažnų ...
Savulionienė, Loreta ; Sakalauskas, Leonidas „Modifikuoto stochastinio dažnų ...Savulionienė, Loreta ; Sakalauskas, Leonidas „Modifikuoto stochastinio dažnų ...
Savulionienė, Loreta ; Sakalauskas, Leonidas „Modifikuoto stochastinio dažnų ...
 
Cluster analysis using k-means method in R
Cluster analysis using k-means method in RCluster analysis using k-means method in R
Cluster analysis using k-means method in R
 

Viewers also liked

Hybrid worlds - Fungi Progression - crews
Hybrid worlds -  Fungi Progression - crewsHybrid worlds -  Fungi Progression - crews
Hybrid worlds - Fungi Progression - crews
rv media
 
Timebanking, ICT, employment and employability in a European context
Timebanking, ICT, employment and employability in a European contextTimebanking, ICT, employment and employability in a European context
Timebanking, ICT, employment and employability in a European context
Taraceas S. Coop. And.
 
joaquina aizpuru
joaquina aizpurujoaquina aizpuru
joaquina aizpuru
Angie Andrea Arango
 
Chap10alg
Chap10algChap10alg
Chap10alg
Munhchimeg
 
Challenges in Implementing Housing First in Ireland – Dr Eoin O'Sullivan
Challenges in Implementing Housing First in Ireland – Dr Eoin O'SullivanChallenges in Implementing Housing First in Ireland – Dr Eoin O'Sullivan
Challenges in Implementing Housing First in Ireland – Dr Eoin O'Sullivan
brianlynch
 
Presentatie gemeente Groningen Inkoopbeleid
Presentatie gemeente Groningen InkoopbeleidPresentatie gemeente Groningen Inkoopbeleid
Presentatie gemeente Groningen Inkoopbeleid
Johan Stuiver
 
Nings To Knols Upload
Nings To Knols UploadNings To Knols Upload
Nings To Knols Upload
guesta3ed78
 
Gagasan perda perlindungan anak kota bandung, juli 2011
Gagasan perda perlindungan anak kota bandung, juli 2011Gagasan perda perlindungan anak kota bandung, juli 2011
Gagasan perda perlindungan anak kota bandung, juli 2011
Zamzam Muzaki Sm
 
Visita Interactiva à Escola
Visita Interactiva à EscolaVisita Interactiva à Escola
Visita Interactiva à Escola
pedro santos
 
Tobch lecture1
Tobch lecture1Tobch lecture1
Tobch lecture1Munhchimeg
 
Chap05alg
Chap05algChap05alg
Chap05alg
Munhchimeg
 
Brochure Subsidie- & Innovatieadvies
Brochure Subsidie- & InnovatieadviesBrochure Subsidie- & Innovatieadvies
Brochure Subsidie- & Innovatieadvies
Johan Stuiver
 
Chap07alg
Chap07algChap07alg
Chap07alg
Munhchimeg
 

Viewers also liked (20)

Hybrid worlds - Fungi Progression - crews
Hybrid worlds -  Fungi Progression - crewsHybrid worlds -  Fungi Progression - crews
Hybrid worlds - Fungi Progression - crews
 
Protsesor
ProtsesorProtsesor
Protsesor
 
Timebanking, ICT, employment and employability in a European context
Timebanking, ICT, employment and employability in a European contextTimebanking, ICT, employment and employability in a European context
Timebanking, ICT, employment and employability in a European context
 
Protsesor
ProtsesorProtsesor
Protsesor
 
joaquina aizpuru
joaquina aizpurujoaquina aizpuru
joaquina aizpuru
 
Chap10alg
Chap10algChap10alg
Chap10alg
 
Lecture915
Lecture915Lecture915
Lecture915
 
Lecture6
Lecture6Lecture6
Lecture6
 
Lecture913
Lecture913Lecture913
Lecture913
 
Challenges in Implementing Housing First in Ireland – Dr Eoin O'Sullivan
Challenges in Implementing Housing First in Ireland – Dr Eoin O'SullivanChallenges in Implementing Housing First in Ireland – Dr Eoin O'Sullivan
Challenges in Implementing Housing First in Ireland – Dr Eoin O'Sullivan
 
Presentatie gemeente Groningen Inkoopbeleid
Presentatie gemeente Groningen InkoopbeleidPresentatie gemeente Groningen Inkoopbeleid
Presentatie gemeente Groningen Inkoopbeleid
 
Nings To Knols Upload
Nings To Knols UploadNings To Knols Upload
Nings To Knols Upload
 
Gagasan perda perlindungan anak kota bandung, juli 2011
Gagasan perda perlindungan anak kota bandung, juli 2011Gagasan perda perlindungan anak kota bandung, juli 2011
Gagasan perda perlindungan anak kota bandung, juli 2011
 
Lecture4
Lecture4Lecture4
Lecture4
 
Visita Interactiva à Escola
Visita Interactiva à EscolaVisita Interactiva à Escola
Visita Interactiva à Escola
 
Tobch lecture1
Tobch lecture1Tobch lecture1
Tobch lecture1
 
Chap05alg
Chap05algChap05alg
Chap05alg
 
Lecture912
Lecture912Lecture912
Lecture912
 
Brochure Subsidie- & Innovatieadvies
Brochure Subsidie- & InnovatieadviesBrochure Subsidie- & Innovatieadvies
Brochure Subsidie- & Innovatieadvies
 
Chap07alg
Chap07algChap07alg
Chap07alg
 

More from Munhchimeg (20)

Ded algorithm1
Ded algorithm1Ded algorithm1
Ded algorithm1
 
Ded algorithm
Ded algorithmDed algorithm
Ded algorithm
 
Tobch lecture
Tobch lectureTobch lecture
Tobch lecture
 
Recursive
RecursiveRecursive
Recursive
 
Lecture916
Lecture916Lecture916
Lecture916
 
Lecture914
Lecture914Lecture914
Lecture914
 
Lecture913
Lecture913Lecture913
Lecture913
 
Lecture911
Lecture911Lecture911
Lecture911
 
Lecture910
Lecture910Lecture910
Lecture910
 
Lecture9
Lecture9Lecture9
Lecture9
 
Lecture8
Lecture8Lecture8
Lecture8
 
Lecture7
Lecture7Lecture7
Lecture7
 
Lecture5
Lecture5Lecture5
Lecture5
 
Lecture3
Lecture3Lecture3
Lecture3
 
Pm104 standard
Pm104 standardPm104 standard
Pm104 standard
 
Pm104 2004 2005
Pm104 2004 2005Pm104 2004 2005
Pm104 2004 2005
 
Lecture916
Lecture916Lecture916
Lecture916
 
Lecture915
Lecture915Lecture915
Lecture915
 
Lecture914
Lecture914Lecture914
Lecture914
 
Lecture912
Lecture912Lecture912
Lecture912
 

Recently uploaded

High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024
Vadym Kazulkin
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
christinelarrosa
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
christinelarrosa
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Pitangent Analytics & Technology Solutions Pvt. Ltd
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
UiPathCommunity
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 

Recently uploaded (20)

High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 

Chap02alg

  • 1. CHAPTER 2 Mathematics for Algorithms
  • 2. Example 2.2.6 Factorial This algorithm computes the factorial of n . factorial ( n ) { i = 1 fact = 1 while ( i < n ) { i = i + 1 fact = fact * i } return fact }
  • 3. Example 2.3.1 Finding the Maximum Value in an Array Using a While Loop This algorithm finds the largest number in the array s [1], s [2], ... , s [ n ]. Input Parameter: s Output Parameters: None array_max_ver1 ( s ) { large = s [1] i = 2 while ( i ≤ s . last ) { if ( s [ i ] > large ) // larger value found large = s [ i ] i = i + 1 } return large }
  • 4. Example 2.4.3 example ( n ) { if ( n == 1) return for i = 1 to n x = x + 1 example( n /2) }