SlideShare ist ein Scribd-Unternehmen logo
1 von 14
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

The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxheathfieldcps1
 
Financial Accounting IFRS, 3rd Edition-dikompresi.pdf
Financial Accounting IFRS, 3rd Edition-dikompresi.pdfFinancial Accounting IFRS, 3rd Edition-dikompresi.pdf
Financial Accounting IFRS, 3rd Edition-dikompresi.pdfMinawBelay
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxneillewis46
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...Krashi Coaching
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxMohamed Rizk Khodair
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxMarlene Maheu
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
How to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryHow to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryCeline George
 
Software testing for project report .pdf
Software testing for project report .pdfSoftware testing for project report .pdf
Software testing for project report .pdfKamal Acharya
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismDabee Kamal
 
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...Denish Jangid
 
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING IIII BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING IIagpharmacy11
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Mohamed Rizk Khodair
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Celine George
 
The Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryThe Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryEugene Lysak
 
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
 
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
 

Kürzlich hochgeladen (20)

The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
 
Financial Accounting IFRS, 3rd Edition-dikompresi.pdf
Financial Accounting IFRS, 3rd Edition-dikompresi.pdfFinancial Accounting IFRS, 3rd Edition-dikompresi.pdf
Financial Accounting IFRS, 3rd Edition-dikompresi.pdf
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptx
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
How to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryHow to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 Inventory
 
Software testing for project report .pdf
Software testing for project report .pdfSoftware testing for project report .pdf
Software testing for project report .pdf
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
IPL Online Quiz by Pragya; Question Set.
IPL Online Quiz by Pragya; Question Set.IPL Online Quiz by Pragya; Question Set.
IPL Online Quiz by Pragya; Question Set.
 
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
 
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING IIII BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).
 
Word Stress rules esl .pptx
Word Stress rules esl               .pptxWord Stress rules esl               .pptx
Word Stress rules esl .pptx
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17
 
The Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryThe Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. Henry
 
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
 
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
 

Code Lab Module1 (GDSC Elizade University)