Search Header Logo
Data Structure & Algorithm

Data Structure & Algorithm

Assessment

Presentation

Computers, Other

10th - 11th Grade

Practice Problem

Easy

Created by

JJSOFT GLOBAL

Used 2+ times

FREE Resource

23 Slides • 1 Question

1

Data Structure & Algorithm

 \sim  B.Eng (HONS) Jafran Jemal 
  (CEO & FOUNDER of JJSOFT)

Slide image

2

Programming

  • Problem solving phase

  • Implementation phase

3

Problem solving phase

produce an ordered sequence of steps that describe solution of problem


this sequence of steps is called an algorithm

4

STEPS IN PROBLEM SOLVING

  • First produce a general algorithm (one can use pseudo code)

  • Refine the algorithm successively to get step by step detailed algorithm that is very close to a computer language

5

Pseudo code

Pseudo code is an artificial and informal language that helps programmers develop algorithms. Pseudo code is very similar to everyday English.

6

Example 1

Write an algorithm to determine a student’s final grade and indicate whether it is passing or failing. The final grade is calculated as the average of four marks.

7

Pseudo code

 Input a set of 4 marks

 Calculate their average by summing and dividing by 4

 if average is below 50 Print “FAIL” else Print “PASS

8

Detailed Algorithm

Step 1: Input M1,M2,M3,M4

Step 2: GRADE (M1+M2+M3+M4)/4

Step 3: if (GRADE < 50) then Print “FAIL” else Print “PASS” endif

9

THE FLOWCHART

 (Dictionary) A schematic representation of a sequence of operations, as in a manufacturing process or computer program.


 (Technical) A graphical representation of the sequence of operations in an information system or program. Information system flowcharts show how data flows from source documents through the computer to final distribution to users. Program flowcharts show the sequence of instructions in a single program or subroutine. Different symbols are used to draw each type of flowchart.

10

A Flowchart

  • shows logic of an algorithm

  • emphasizes individual steps and their interconnections

  • e.g. control flow from one action to the next

11

Slide image

12

Exercise 1

Write an algorithm and draw a flowchart that will read the two sides of a rectangle and calculate its area.


Pseudocode

Input the width (W) and Length (L) of a rectangle Calculate the area (A) by multiplying L with W

Print A

13

Algorithm

  • Step 1: Input W,L

  • Step 2: A L x W

  • Step 3: Print A

14

DECISION STRUCTURES ( IF-THEN-ELSE )

  • The expression A>B is a logical expression

  • it describes a condition we want to test

  • if A>B is true (if A is greater than B) we take the action on left

  • print the value of A 

15

Slide image

16

Slide image

17

Slide image

18

Slide image

19

Slide image

20

Slide image

21

Implementation phase

implement the program in some programming language

22

Implementation (Live Coding)

Bonouse -> Convert Algorithm to ≻ Working Program/App

23

Open Ended

Today what do you learned ?

24

Thank You

Data Structure & Algorithm

 \sim  B.Eng (HONS) Jafran Jemal 
  (CEO & FOUNDER of JJSOFT)

Slide image

Show answer

Auto Play

Slide 1 / 24

SLIDE