0% found this document useful (0 votes)
6 views

Algo1ING_Ch0

Uploaded by

nademdz123
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Algo1ING_Ch0

Uploaded by

nademdz123
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Essentials of the course

ALGORITHMICS & DATA STRUCTURES 1


(CS ENG.)
(VERSION 2024-25)
Pr. Boulif M.
Overview:

ch0 : Generalities
ch1 : Basic concepts
ch2 : Control Structures
ch3 : Unidimensional arrays
ch4 : Bidimensional arrays
ch5 : Strings
ch6 : Parametrized actions

References

1. Mounira Belmesk et Nacera Bensaou, Algorithmes et structures de données, Khawarysm, 1991.


2. Claude Delannoy, Programmer en langage C, Eyrolles, 2007.
3. Ivor Horton, Beginning C, 5th Edition (Expert's Voice in C), Apress, 2013.
4. Jean-Claude Faure, Emploi des ordinateurs, Dunod 1971.
5. Internet : Par exemple,
OpenClassrooms (ex. site du zéro), Developpez.com, Stackoverflow, etc.
https://openclassrooms.com/fr/courses https://general.developpez.com/cours/ https://stackoverflow.com/

6. Other refs I forgot.

1
Chapter 0

GENERALITIES

0.1 PRESENTATION OF A COMPUTER


A computer is commonly composed of the following components :
1. A central processing unit (CPU);
2. A main memory (RAM);
3. A keyboard;
4. A screen;
5. some interfaces of connexion to peripherals like : dvd reader, printers, scanner, networks, … etc.

DVD reader

RAM
Screen
CPU

Interfaces
of
connexion keyboard

Figure 0.1 A computer

These components form the hardware part of a computer which can be schematised by the diagram:

Peripherals
Main
CPU memory

Figure 0.2 Architecture of Von Neumann

In this diagram the following components appear:


1. The central processing unit or CPU: Executes the instructions of programs written in a machine
language.
2. The main memory: contains the programs that specify the instructions to execute and the informations
or data to be handled by these instructions.
3. The peripherals or input/output devices: used to introduce programs and data to the main memory, and
to communicate the results of the conducted activities.
4. Buses to link the previous components.

2
0.2 SOFTWARE AND HARDWARE
The entire set of hardware components is of no use (the first meaning of the word "hardware" was tools or
equipment). To become useful, it must be associated with another part known as software. Indeed, a
computer user essentially requests two types of services:

1. Creating and naming files; storing these files on storage media (e.g., flash drive); transferring information
between files and input/output devices (screen, keyboard, printer).
2. Executing existing programs or those introduced to the computer; data is entered via the keyboard or
taken from a file; results are displayed on the screen, printed out, or copied into a file.

None of these processes are possible without software. Generally, software is divided into two parts: the
operating system and application software.

An operating system, such as Linux or Windows, allows for the following two functions:

1. Managing the user's tasks by hiding operational details from them.


2. Managing the computer's resources by controlling and allocating them to various running applications
(programs) in a reasonable manner.

Application software enables users to perform specific tasks such as word processing (WinWord, Libre
Office Writer), programming (CodeBlocks, PyCharm), web browsing (Firefox, Internet Explorer), etc.

0.3 INFORMATION REPRESENTATION


Computers, although they can process text, project videos, run games, etc., are capable of only one thing:
performing calculations. The truth is that when a computer processes text, images, sound, or video, it is
only processing numbers encoded in binary.

0.3.1 Binary Information


Binary information can have only two states: on or off, free or occupied, white or black, right or left, true or
false, etc. A computer has different physical media capable of storing binary information: Random Access
Memory (RAM) consists of millions of electronic components that can hold or release an electric charge.
The surface of a hard drive, tape, or floppy disk is covered with metallic particles that can be magnetically
oriented in one direction or another. On a CD-ROM, there is a long narrow groove irregularly punctured
with holes.

0.3.2 Representation of Binary Information


Binary information, regardless of its physical medium, is symbolized in the form of 1s and 0s.

3
0.4 HANDLING PROGRAMS
Applications are programs originally written in high-level programming languages close to human language,
such as Pascal and C. To be executed, these programs are transformed by software tools. These tools, which
can be separate or integrated, are described as follows:

Source Source Object Object


program, Text Program, Compiler program Linker program Execution
paper editor file Extension OBJ Extension EXE

Figure 0.3 User program life cycle

0.4.1 Text Editor


This is a program that allows for the input of text and saves it in a text file. It is used to write the source
code of the user program in a high-level language.
Example: Notepad in Windows.

0.4.2 Compiler
This is a program that translates the source code written in an advanced language into a binary program
understood by the machine. The resulting binary program is called the object program.
Example: gcc, which includes the C compiler from the GNU project under UNIX.

0.4.3 Linker
This is a program that assembles the object code of the user program along with predefined procedures and
functions into a single executable program. Once this step is completed, the user program is ready to be
handled by the operating system.

0.5 ALGORITHMIC APPROACH TO PROGRAMMING


Programming provides a means of communicating with a computer, as natural language is too complex for
a machine lacking intelligence to understand. Therefore, learning a programming language is necessary.
However, there are several programming languages, making it difficult to say that one is better than the
others in all respects. Fortunately, all these languages have common points, which are summarized in what
we call algorithmic language. Subsequently, to write a program, one begins by writing an algorithm using
the algorithmic language; then, the transition to the program is made by replacing each algorithmic
instruction with its equivalent in the chosen programming language.

You might also like