SlideShare ist ein Scribd-Unternehmen logo
Code Lab
Module 1:
Introduction to
Problem Solving
Opeoluwa Daniel Oyedeji
GDSC Lead, E.U.
Elizade University
What is problem
solving?
Problem-solving refers to a
systematic approach to analyzing the
problem, developing a solution
(algorithm), and implementing that
solution in code.
Divide and Conquer
Problem-Solving Approaches
When tackling coding problems,
there are two main approaches you
can take to break them down and
develop a solution.
1. Top-Down Approach
2. Bottom-Up Approach
Top-Down Approach
This approach starts with the big
picture and works its way down.
1. Understand the overall
problem and break it down
into smaller subproblems.
1. Solve each subproblem
independently, and then
combine the solutions to
form the final solution to
the larger problem.
Top-Down Approach:
Calculating Area
1. Identify the whole shape.
2. Divide it into simpler
shapes.
3. Calculate the area of
each simple shape.
4. Combine the areas to find
the total area.
Top-Down Approach:
Calculating Area
1. Identify the whole shape.
2. Divide it into simpler
shapes.
3. Calculate the area of
each simple shape.
4. Combine the areas to find
the total area.
Semicircle
Area
Rectangle
Area
Triangle
Area
Total Area
Chart 1
Bottom-Up Approach
This approach starts with the
building blocks and works its way
up.
1. Start with the most basic
operations needed to solve
the problem.
1. Combine these operations
into larger functions to
create the overall
solution.
Bottom-Up Approach:
Counting Vowels
1. Implement a function to
identify vowels.
1. Implement a function to
iterate through the list.
Vowels : (a, e, i, o, u)
List: (b, d, c, a, z, x, i, l, f)
Identify vowels
// Basic Operation
private static boolean isVowel(char x) {
char[] vowels = { 'a', 'e', 'i', 'o', 'u' };
for (int i = 0; i < vowels.length; i++)
if (vowels[i] == x)
return true;
return false;
}
Iterate through list
// Larger Function
private static int countVowels(char[] arr) {
int count = 0;
for (int i = 0; i < arr.length; i++)
if (isVowel(arr[i]))
count++;
return count;
}
Recap
Introduction to Problem Solving

Weitere ähnliche Inhalte

Ähnlich wie Code Lab Module1 (GDSC Elizade University)

Problem Solving Aspects.pptx
Problem Solving Aspects.pptxProblem Solving Aspects.pptx
Problem Solving Aspects.pptxnikitakolambe21
 
Esemen Matematik Penyelesaian Masalah
Esemen Matematik Penyelesaian MasalahEsemen Matematik Penyelesaian Masalah
Esemen Matematik Penyelesaian MasalahSyafiqah Mohamed Noor
 
Creative Problem Solving Skills For Staff
Creative Problem Solving Skills For StaffCreative Problem Solving Skills For Staff
Creative Problem Solving Skills For StaffPaul Nguyen
 
001 Wholebrain Problem Solving Slides
001 Wholebrain Problem Solving Slides001 Wholebrain Problem Solving Slides
001 Wholebrain Problem Solving SlidesAlan Barker
 
Chapter-11.-Problem-solving-creativity_2.0 (1).ppt
Chapter-11.-Problem-solving-creativity_2.0 (1).pptChapter-11.-Problem-solving-creativity_2.0 (1).ppt
Chapter-11.-Problem-solving-creativity_2.0 (1).pptkarengempesaw
 
problem solving presentation.pptx
problem solving presentation.pptxproblem solving presentation.pptx
problem solving presentation.pptxStewartSheckler
 
Problem solving technique , strategies
Problem solving technique , strategiesProblem solving technique , strategies
Problem solving technique , strategiesHussein Kareem
 
Introduction to Programming
Introduction to ProgrammingIntroduction to Programming
Introduction to ProgrammingALI RAZA
 
Instructional Strategies: Indirect Instruction in your lessons
Instructional Strategies: Indirect Instruction in your lessonsInstructional Strategies: Indirect Instruction in your lessons
Instructional Strategies: Indirect Instruction in your lessonsCaryn Chang
 

Ähnlich wie Code Lab Module1 (GDSC Elizade University) (20)

Problem Solving Aspects.pptx
Problem Solving Aspects.pptxProblem Solving Aspects.pptx
Problem Solving Aspects.pptx
 
Unit2 problem solving
Unit2 problem solvingUnit2 problem solving
Unit2 problem solving
 
Unit 2 Problem Solving
Unit 2 Problem SolvingUnit 2 Problem Solving
Unit 2 Problem Solving
 
Unit 2 Problem Solving
Unit 2 Problem SolvingUnit 2 Problem Solving
Unit 2 Problem Solving
 
problem characterstics.pptx
problem characterstics.pptxproblem characterstics.pptx
problem characterstics.pptx
 
Mental Models2
Mental Models2Mental Models2
Mental Models2
 
1_Steps_in_Problem_Solving.ppt
1_Steps_in_Problem_Solving.ppt1_Steps_in_Problem_Solving.ppt
1_Steps_in_Problem_Solving.ppt
 
Esemen Matematik Penyelesaian Masalah
Esemen Matematik Penyelesaian MasalahEsemen Matematik Penyelesaian Masalah
Esemen Matematik Penyelesaian Masalah
 
Do you follow instructions
Do you follow instructionsDo you follow instructions
Do you follow instructions
 
Creative Problem Solving Skills For Staff
Creative Problem Solving Skills For StaffCreative Problem Solving Skills For Staff
Creative Problem Solving Skills For Staff
 
BMME7.4 Eunit doc2
BMME7.4 Eunit doc2BMME7.4 Eunit doc2
BMME7.4 Eunit doc2
 
001 Wholebrain Problem Solving Slides
001 Wholebrain Problem Solving Slides001 Wholebrain Problem Solving Slides
001 Wholebrain Problem Solving Slides
 
Chapter-11.-Problem-solving-creativity_2.0 (1).ppt
Chapter-11.-Problem-solving-creativity_2.0 (1).pptChapter-11.-Problem-solving-creativity_2.0 (1).ppt
Chapter-11.-Problem-solving-creativity_2.0 (1).ppt
 
PPS_Unit 1.pptx
PPS_Unit 1.pptxPPS_Unit 1.pptx
PPS_Unit 1.pptx
 
mgt312 part1
mgt312 part1mgt312 part1
mgt312 part1
 
problem solving presentation.pptx
problem solving presentation.pptxproblem solving presentation.pptx
problem solving presentation.pptx
 
Problem solving technique , strategies
Problem solving technique , strategiesProblem solving technique , strategies
Problem solving technique , strategies
 
Introduction to Programming
Introduction to ProgrammingIntroduction to Programming
Introduction to Programming
 
Unit a
Unit aUnit a
Unit a
 
Instructional Strategies: Indirect Instruction in your lessons
Instructional Strategies: Indirect Instruction in your lessonsInstructional Strategies: Indirect Instruction in your lessons
Instructional Strategies: Indirect Instruction in your lessons
 

Kürzlich hochgeladen

size separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticssize separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticspragatimahajan3
 
ppt your views.ppt your views of your college in your eyes
ppt your views.ppt your views of your college in your eyesppt your views.ppt your views of your college in your eyes
ppt your views.ppt your views of your college in your eyesashishpaul799
 
How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17Celine George
 
Advances in production technology of Grapes.pdf
Advances in production technology of Grapes.pdfAdvances in production technology of Grapes.pdf
Advances in production technology of Grapes.pdfDr. M. Kumaresan Hort.
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Mohamed Rizk Khodair
 
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General QuizPragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General QuizPragya - UEM Kolkata Quiz Club
 
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdf
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdfPost Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdf
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdfPragya - UEM Kolkata Quiz Club
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxShibin Azad
 
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdfTelling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdfTechSoup
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersPedroFerreira53928
 
[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online PresentationGDSCYCCE
 
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Celine George
 
....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdfVikramadityaRaj
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...Nguyen Thanh Tu Collection
 
Open Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPointOpen Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPointELaRue0
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxCapitolTechU
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsCol Mukteshwar Prasad
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
 

Kürzlich hochgeladen (20)

size separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticssize separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceutics
 
ppt your views.ppt your views of your college in your eyes
ppt your views.ppt your views of your college in your eyesppt your views.ppt your views of your college in your eyes
ppt your views.ppt your views of your college in your eyes
 
How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17
 
Advances in production technology of Grapes.pdf
Advances in production technology of Grapes.pdfAdvances in production technology of Grapes.pdf
Advances in production technology of Grapes.pdf
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).
 
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General QuizPragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
 
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdf
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdfPost Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdf
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdf
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptx
 
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdfTelling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation
 
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
 
....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
 
“O BEIJO” EM ARTE .
“O BEIJO” EM ARTE                       .“O BEIJO” EM ARTE                       .
“O BEIJO” EM ARTE .
 
Open Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPointOpen Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPoint
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
 
B.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdfB.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdf
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 

Code Lab Module1 (GDSC Elizade University)