Introduction A L'algorithmique
Introduction A L'algorithmique
Dr. Mohamed BADECHE Common Core – MI, NICT Faculty – 1st year (2023-2024)
Introduction to algorithms
Chargé de cours
Name Grade Faculty/Institute E-mail
mail address
BADECHE Mohamed MCB New technologies [email protected]
algo.assistance
Etudiants concernés
Faculty/Institute Department Year Speciality
New technologies MI License 1 Common Core
Goals :
Introduce the concept of algorithm.
State syntactic conventions.
Become familiar with the basic instructions.
Getting started with conditional and repetitive processing.
Course : Introduction to algorithms Constantine 2 University – Abdelhamid Mehri
Dr. Mohamed BADECHE Common Core – MI, NICT Faculty – 1st year (2023-2024)
Sommaire
Chapter 1: Introduction .......................................................................................................................................................... 1
1.1. Components of a computer ......................................................................................................................................... 1
Chapter 2: Algorithm .............................................................................................................................................................. 2
2.1. Introduction to the concept of algorithm .................................................................................................................... 2
2.1.1. Simple examples of program execution ............................................................................................................... 2
2.1.2. Algorithm example................................................................................................................................................ 3
2.1.3. Definition of an algorithm..................................................................................................................................... 3
2.1.4. Structure of an algorithm ..................................................................................................................................... 4
2.1.5. Basic instructions (‘Read’, ‘Write’ and assignment) ............................................................................................. 4
2.1.6. Algorithm vs Program ........................................................................................................................................... 5
2.1.7. User vs Programmer (Developer) ......................................................................................................................... 5
Course : Introduction to algorithms Constantine 2 University – Abdelhamid Mehri
Dr. Mohamed BADECHE Common Core – MI, NICT Faculty – 1st year (2023-2024)
Chapter 1: Introduction
Computer science
Hardware Software
1
Course : Introduction to algorithms Constantine 2 University – Abdelhamid Mehri
Dr. Mohamed BADECHE Common Core – MI, NICT Faculty – 1st year (2023-2024)
Chapter 2: Algorithm
Description of
Running a program in Visual Basic (VB) Executing a program in C language
execution steps
Private Sub Form_Load() int main()
{
Dim a, b, c As Integer int a, b, c;
a = InputBox("") scanf("%d",&a);
Program code
b = InputBox("") scanf("%d ",&b);
c=a*b c = a*b;
MsgBox (c) printf("%d", c);
End sub }
2
Course : Introduction to algorithms Constantine 2 University – Abdelhamid Mehri
Dr. Mohamed BADECHE Common Core – MI, NICT Faculty – 1st year (2023-2024)
1
Wikipedia
2
Philippe Flajolet, Étienne Parizot, « Qu'est ce qu'un algorithme ? », interstices.fr, 2004.
3
Course : Introduction to algorithms Constantine 2 University – Abdelhamid Mehri
Dr. Mohamed BADECHE Common Core – MI, NICT Faculty – 1st year (2023-2024)
4
Course : Introduction to algorithms Constantine 2 University – Abdelhamid Mehri
Dr. Mohamed BADECHE Common Core – MI, NICT Faculty – 1st year (2023-2024)
The assignment instruction always has a variable in its left part and can have in its right part, either a constant
(A 3.14), or a variable which has a value (A B), or an evaluable expression (A B*2+3). Writings like:
3.14 A, A + 2 B and A B 5 are syntactically incorrect.
The Write instruction displays either variable values: Write(A), or messages: Write("Hello"), or a combination
of messages and variables: Write("the area of the circle is ", A, " cm2").
By convention in this course, the Write instruction displays and jumps to the line.
Algorithm Program
Pseudo code Code
Not directly executable on machine 3 Executable directly on machine
It was created for the programming service
Inputs Outputs
Treatment
The programmer must sometimes put himself in the user's shoes to test his program himself, and thus plays
both roles.
3
The case of applications like 'AlgBox' on PC or 'Algo' on Smartphone, which in appearance allow you to execute algorithms, are in
reality only educational tools for simulating the execution of an algorithm on a machine.
5