Code Lab Module2 (GDSC Elizade University)

OpeoluwaOyedeji 19 views 13 slides May 27, 2024
Slide 1
Slide 1 of 13
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13

About This Presentation

This session equips you with the foundational skills of Algorithmic Thinking.


Slide Content

Code Lab Module 2: Algorithmic Thinking Opeoluwa Daniel Oyedeji GDSC Lead, E.U. Elizade University

What is an Algorithm? Algorithmic Thinking

An algorithm is a set of instructions to solve a well-defined problem.

Basic algorithmic concepts Algorithmic Thinking

Basic algorithmic concepts Sequencing Selection (if/else) Loops (for/while) Functions Recursion

Sequencing This is like following a recipe step-by-step. Instructions execute one after another. Instructions execute in the order they are written.

Selection (if/else) Imagine a decision point. This checks a condition and executes different instructions based on whether the condition is true or false. If it is raining wear a raincoat. Else wear sunscreen.

Loops (for/while) Think of repeating a task a certain number of times (for loop) or until a condition is met (while loop). W atering your plants every day (for loop). Continuing to search for something until you find it (while loop).

Functions These are reusable blocks of code that perform a specific task. Think of them as tools in your coding toolbox. You can give them a name and use them throughout your code whenever you need that task done.

Recursion Imagine a function calling itself! It solves a problem by breaking it down into smaller versions of the same problem, until it reaches a simple case. Base Case: Simplest problem, recursion stops here. Recursive Case: Calls itself with a smaller problem.

Coding Examples A lgorithmic Thinking

LeetCode Problems Count Odd Numbers Power of Two Power of Three Fibonacci Number

Recap A lgorithmic Thinking
Tags