A typical programming task can be divided into two phases:
Problem-solving phase: produce an ordered sequence of steps that describe the solution of the problem this sequence of steps is called an algorithm.
Implementation phase: implement the program in some programming language.
Every algorithm must satisfy the following criteria:
Input. Zero or more quantities are externally supplied.
Output. At least one quantity is produced.
Definiteness. Each instruction must be clear and unambiguous(Unique meaning).
Finiteness. An algorithm terminates in a finite number of steps.
Effectiveness. Every instruction must be basic enough to be carried out than, means not so complex.
An algorithm is a finite set of steps defining the solution of a particular problem.
What is the difference between an algorithm and a program?
a program is an implementation of an algorithm to be run on a specific computer and operating system.
an algorithm is more abstract – it does not deal with machine-specific details – think of it as a method to solve a problem.
What is a good algorithm?
Efficient algorithms are good, we generally measure the efficiency of an algorithm based on:
Time: the algorithm should take minimum time to execute.
Space: the algorithm should use less memory.
DIFFERENCE BETWEEN ALGORITHM AND PSEUDOCODE?
An algorithm is a well-defined sequence of steps that provides a solution for a given problem, while pseudocode is one of the methods that can be used to represent an algorithm.
While algorithms can be written in natural language, pseudocode is written in a format that is closely related to high-level programming language structures.
But pseudocode does not use specific programming language syntax and therefore could be understood by programmers who are familiar with different programming languages. Additionally, transforming an algorithm presented in pseudocode to programming code could be much easier than converting an algorithm written in natural language.
But pseudocode does not use specific programming language syntax and therefore could be understood by programmers who are familiar with different programming languages.
Additionally, transforming an algorithm presented in pseudocode to programming code could be much easier than converting an algorithm written in natural language.
Pipelining is an speed up technique where multiple instructions are overlapped in execution on a processor. It is an important topic in Computer Architecture.
This slide try to relate the problem with real life scenario for easily understanding the concept and show the major inner mechanism.
Algorithms Lecture 1: Introduction to AlgorithmsMohamed Loey
We will discuss the following: Algorithms, Time Complexity & Space Complexity, Algorithm vs Pseudo code, Some Algorithm Types, Programming Languages, Python, Anaconda.
We have learnt that any computer system is made of hardware and software.
The hardware understands a language, which humans cannot understand. So we write programs in high-level language, which is easier for us to understand and remember.
These programs are then fed into a series of tools and OS components to get the desired code that can be used by the machine.
This is known as Language Processing System.
Pipelining is an speed up technique where multiple instructions are overlapped in execution on a processor. It is an important topic in Computer Architecture.
This slide try to relate the problem with real life scenario for easily understanding the concept and show the major inner mechanism.
Algorithms Lecture 1: Introduction to AlgorithmsMohamed Loey
We will discuss the following: Algorithms, Time Complexity & Space Complexity, Algorithm vs Pseudo code, Some Algorithm Types, Programming Languages, Python, Anaconda.
We have learnt that any computer system is made of hardware and software.
The hardware understands a language, which humans cannot understand. So we write programs in high-level language, which is easier for us to understand and remember.
These programs are then fed into a series of tools and OS components to get the desired code that can be used by the machine.
This is known as Language Processing System.
Memory management is the act of managing computer memory. The essential requirement of memory management is to provide ways to dynamically allocate portions of memory to programs at their request, and free it for reuse when no longer needed. This is critical to any advanced computer system where more than a single process might be underway at any time
To understand algorithm and flowchart, it is better to refer this Slideshare that I have created. I have thoroughly presented the key points that make easy in remembering what algorithm and flowchart is. The slide is really simple and wonderful to use it for a quick reference.
Memory management is the act of managing computer memory. The essential requirement of memory management is to provide ways to dynamically allocate portions of memory to programs at their request, and free it for reuse when no longer needed. This is critical to any advanced computer system where more than a single process might be underway at any time
To understand algorithm and flowchart, it is better to refer this Slideshare that I have created. I have thoroughly presented the key points that make easy in remembering what algorithm and flowchart is. The slide is really simple and wonderful to use it for a quick reference.
This power point contains:
The Problem Solving Aspect, Problem definition phase, Getting started on a problem, The use of specific examples Similarities among problems,
Working backwards from the solution, General Problem solving strategies
Introduction to programming in C, First Program in C
Variables and Identifiers, Data types, Basic Input Output in C - Characters, Basic Input Output in C - Formatted IO
Arithmetic Operators, Relational and Logical Operators, More Operators, Precedence and Associativity of operators
If statement, if-else statement, if statement mistakes, nested if statements.Decision control sturctures.
Conditional Operator, Switch statement
Decision control sturctures (contd.).
While loop, Looping - For loop, Control with break and continue, Variants of for loop. Iterative control structures.
Nested for loops , Printing patterns with loops, do-while loop. Iterative control structures (Contd.).
Functions in c, Definition and declaration of a function, Scope of a function
auto storage class, extern storage class, static storage class, register storage class
Introduction to Pointers in C, Parameter passing techniques, Pointer Arithmetic in C, Pointer Arithmetic with Pointers
Arrays, Searching an Element, Arrays and Memory in C
Pointers with Arrays, Functions and Arrays
2D Arrays. Implementation, basic transformations on 2D arrays like transpose, addition, subtraction and multiplication.
Introduction to recursion, Recursion basic programs like: factorial, Fibonacci, sum of digits
Computer – Hardware
Hardware represents the physical and tangible components of a computer, i.e. the components that can be seen and touched.
Examples of Hardware are the following −
Input devices − keyboard, mouse, etc.
Output devices − printer, monitor, etc.
Secondary storage devices − Hard disk, CD, DVD, etc.
Internal components − RAM,CPU, motherboard, etc.
INPUT AND OUTPUT DEVICES OF COMPUTER Input Devices A device that can be used to insert data into a computer system is called as input device. It allows people to supply information to computers without any input devices, a computer would only be a display device and not allow users to interact with it, Examples of input devices include keyboards, mouse, scanners, digital cameras and Light pen, joysticks, Touch-screen, OMR, OBR,OCR. Keyboard Most common and very popular input device is keyboard. The keyboard helps in inputting the data to the computer. The layout of the keyboard is like that of traditional typewriter, although there are some additional keys provided for performing some additional functions. Keyboard is of two sizes 84 keys or 101/102 keys, but now 104 keys or 108 keys keyboard is also available for Windows and Internet. Mouse Mouse is most popular Pointing device. It is a very famous cursor-control device. It is a small palm size box with a round ball at its base which senses the movement of mouse and sends corresponding signals to CPU on pressing the buttons. Generally it has two buttons called left and right button and scroll bar is present at the mid. Mouse can be used to control the position of cursor on screen, but it cannot be used to enter text into the computer.
Computer
A computer is an electronic device, operating under the control of instructions stored in its own memory that can accept data (input), process the data according to specified rules, produce information (output), and store the information for future use.
“A computer is an electronic machine that accepts information, stores it until the information is needed, processes the information according to the instructions provided by the user, and finally returns the results to the user. The computer can store and manipulate large quantities of data at very high speed, but a computer cannot think. A computer makes decisions based on simple comparisons such as one number being larger than another. Although the computer can help solve a tremendous variety of problems, it is simply a machine. It cannot solve problems on its own”.
Characteristics / Features of computer
1: High speed: Computers have the ability to perform routine tasks at a greater speed than human beings. They can perform millions of calculations in seconds.
2. Accuracy : Computers are used to perform tasks in a way that ensures accuracy.
3. Storage : Computers can store large amount of information. Any item of data or any instruction stored in the memory can be retrieved by the computer at lightning speeds.
4. Automation : Computers can be instructed to perform complex tasks automatically ( which increases the productivity).
5. Diligence : Computers can perform the same task repeatedly & with the same accuracy without getting tired.
6. Versatility : Computers are flexible to perform both simple and complex tasks.
7. Cost effectiveness: Computers reduce the amount of paper work and human effort, thereby reducing costs.
Q: What is Technology?
Ans: To convert the knowledge of science into a device or machine is ĐĂůůĞĚ͞dechnology͟.
OR
To invent a device or machine with the help of study of science is called ͞dechnology͘͟
1) COMPUTER TECHNOLOGY:
Computer is an electronic device use
to perform arithmetic and logical operations it accepts data as input process or manipulates the data and give out put which also called information it also has a stored program concept feature so it can save any type of information. It purpose is to speed up problem solving and increase productivity. A computer system is a combination of hardware and software.
2) COMMUNICATION TECHNOLOGY:
Communication technology also called telecommunications technology consists of electromagnetic devices and systems for communicating over long distances. For example: Telephone, radio, broadcast television, and cable T.V etc.
3) INFORMATION TECHNOLOGY:
When computer and communications technologies are combined, the result is Information Technology, or ͞ŝŶĨŽƚĞĐŚ͘͟/ŶĨŽƌŵĂƚŝŽŶdĞĐŚŶŽůŽŐLJ;/dͿŝƐĂŐĞŶĞƌĂůƚĞƌŵƚŚĂƚĚĞƐĐƌŝďĞƐany technology that helps to produce, manipulate, store, communicate, and/or disseminate information. IT merges computing with high-speed
Communications links carrying data, sound, and video. Examples of information technology include personal computers but also new forms of telephones, televisions, appliances, and various handheld devices.
4) TECHNOLOGY CONVERGENCE:
Technology Convergence describes the combining of several industries through various devices that exchange data in the format used by computers. The industries are computers, communications, consumer electronics, entertainment, and mass media. Convergence has led to electronic products that perform multiple functions, such as TVs with internet access, cell phones that are also digital cameras etc.
The computer itself the hardware cannot do anything. The ingredient that enables a computer to perform a specific task is software, which consists of electronic instructions. These instructions tell the machine’s physical components what to do; without them, a computer could not do anything at all.
System Software:
The program directly related to the hardware of the computer and which perform the fundamental task are termed as system software.
Several programs may be included in system software but the following are essential for any computer.
Language Translators
A Particular translator is required to execute any high-level language program.
Each language has a different language translator, while the function of each translator is to convert the high-level program into machine code.
These translators are categorized into the following groups.
Interpreter:
These translators translate only one instruction at a time and execute it. After execution, the translation is erased from memory and the next instruction is loaded for translation. Therefore translation is required again if the program is executed again.
It is a limitation of interpreters that it forgets translation after the execution of the instruction.
A GWBASIC interpreter is required to run GWBASIC programs.
Each programming language has its separate interpreter if it is designed.
Compiler
These translators are used to translate the entire program at once and store their translated program on disk.
The original program is called “Source Program” while its translated program is called “Object Program”.
These translators can not execute an object program.
The object program has to go through some other stages to be able to execute.
Assembler
The assemblers are language translators for low-level symbolic language programs.
Assemblers can translate a source program into an object program.
An assembler translates one source instruction into exactly one machine code.
The linking process is required on the object program to be able to execute it.
Each low-level symbolic language has its assembler.
C is mother language of all programming language.
It is a system programming language. It is a procedure-oriented programming language. It is also called mid-level programming language.
C evolved from a language called B, written by Ken Thompson at Bell Labs in 1970. Ken used B to write one of the first implementations of UNIX. B in turn was a descendant of the language BCPL (developed at Cambridge (UK) in 1967), with most of its instructions removed.
So many instructions were removed in going from BCPL to B, that Dennis Ritchie of Bell Labs put some back in (in 1972), and called the language C.
The famous book The C Programming Language was written by Kernighan and Ritchie in 1978, and was the definitive reference book on C for almost a decade.
The original C was still too limiting, and not standardized, and so in 1983, an ANSI committee was established to formalize the language definition.
It has taken until now (ten years later) for the ANSI ( American National Standard Institute) standard to become well accepted and almost universally supported by compilers.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
How to Split Bills in the Odoo 17 POS ModuleCeline George
Bills have a main role in point of sale procedure. It will help to track sales, handling payments and giving receipts to customers. Bill splitting also has an important role in POS. For example, If some friends come together for dinner and if they want to divide the bill then it is possible by POS bill splitting. This slide will show how to split bills in odoo 17 POS.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
2. z
Contents
LECT # 2
Algorithm
Definition of algorithm
Need of algorithm
Designing of algorithm
Pseudocode
Examples
2
FARZANASHAHICS
3. z
ALGORITHMS AND Program
3
A typical programming task can be divided into
two phases:
Problem solving phase
produce an ordered sequence of steps that describe
solution of problem
this sequence of steps is called an algorithm
Implementation phase
implement the program in some programming
language
FARZANASHAHICS
7. z
Analgorithmis a precisestep-by-
stepplanfora computational
procedure that possiblybeginswith
aninput valueandyieldsanoutput
valuein a finite numberofsteps in
orderto solve a particular problem
FARZANASHAHICS
7
8. z
Analgorithm is a self-containedstep-by-stepset of
operationsto be performedto solve a specific
problemor a class ofproblems.
A computerprogramis a sequence ofinstructions
that complytherulesofa specificprogramming
language , written to performa specifiedtaskwith
a computer.
FARZANASHAHICS
8
9. z
Algorithms
9
An algorithm is a finite set of steps defining the
solution of a particular problem.
Need not to belong one particular language
Sequence of English statements can also be algorithm
It is not a computer program
An algorithm can be expressed in English like
language, called pseudocode, in a programming
language or in the form of flowchart.
FARZANASHAHICS
10. z
WhyAlgorithm is needed?
10
Computer Program ?
Set of instructions to perform some specific task
Is Program itself a Software ?
NO, Program is small part of software.
Software merely comprises of Group of Programs
(Source code),
Code: refers to statements that are written in any
programming language as machine code or C code.
•Code is some time interchangeably used with
program.
FARZANASHAHICS
11. z WhyAlgorithm is needed?FARZANASHAHICS
11
• Programming is both tedious and exciting.
Tedious because like spoken languages
programming languages also have so many
demanding rules.
Exciting because writing program provides the
programmer with the chance to create
something new also gives challenges of solving
a problem.
12. z WhyAlgorithm is needed?
12
It is very difficult to write direct programs in
any language, just like you can not start
constructing building without the design of
building.
For constructing a building you need design of
building, similarly for writing a large or good
program you need algorithm.
FARZANASHAHICS
13. z Program design
13
Program Design Process has 2 phases:
Problem Solving Phase
Creates an algorithm that solves the problem
Implementation (Coding) Phase
Translates the algorithm into a programming
language
Algorithm
Problem Program
FARZANASHAHICS
14. z Algorithm Vs Program
14
What is the difference between an algorithm and a program?
a program is an implementation of an algorithm to be run on a
specific computer and operating system.
an algorithm is more abstract – it does not deal with machine
specific details – think of it as a method to solve a problem.
•What is good algorithm?
Efficient algorithms are good, we generally measure efficiency of
an algorithm on the basis of:
1.Time: algorithm should take minimum time to execute.
2.Space: algorithm should use less memory.
FARZANASHAHICS
15. z
Algorithm Specification
Every algorithm must satisfy the following
criteria:
Input. Zero or more quantities are externally supplied.
Output. At least one quantity is produced.
Definiteness. Each instruction must be clear and
unambiguous(Unique meaning).
Finiteness. An algorithm terminates in a finite number of steps.
Effectiveness. Every instruction must be basic enough to be carried
out than, means not so complex.
15
FARZANASHAHICS
16. z Pseudocode
16
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.
Pseudo code is an artificial and informal
language that helps programmers develop
algorithms. Pseudo code is very similar to
everyday English.
FARZANASHAHICS
17. z
DIFFERENCE BETWEEN ALGORITHM
AND PSEUDOCODE?
17
An algorithm is a well defined sequence of steps that
provides a solution for a given problem, while a
pseudocode is one of the methods that can be used to
represent an algorithm.
While algorithms can be written in natural language,
pseudocode is written in a format that is closely related
to high level programming language structures.
FARZANASHAHICS
18. z
DIFFERENCE BETWEEN ALGORITHM
AND PSEUDOCODE?
18
But pseudocode does not use specific programming
language syntax and therefore could be understood by
programmers who are familiar with different
programming languages.
Additionally, transforming an algorithm presented in
pseudocode to programming code could be much
easier than converting an algorithm written in natural
language.
FARZANASHAHICS
21. z
Example 1
21
Average Of Two numbers
Input: Two numbers
1.Add the two numbers
2.Divide the result by 2
3.Return the result by step 2 2 End
Write an algorithm that reads two numbers and prints
their average.
FARZANASHAHICS
22. z
Example 2
22
Pass/FailGrade
Input: One number
1.if (the number is greater than or
equal to 40) then
1.Set the grade to “pass” else
2.Set the grade to “fail” End if
2.Return the grade End
Write an algorithm that reads marks number
and prints whether student is pass or fail.
FARZANASHAHICS
23. z
Example 3
23
Marks range Grade
>=80 A
>=70 &<80 B
>=60 &<70 C
>=50 &<60 D
<50 F
Write an algorithm that read a numbers and prints
the grade of student.
FARZANASHAHICS
24. z
Algorithm for Grading
AlgoForGrade
Input: One number
1.if (the number is between 80 and 100, inclusive)
then
1. Set the grade to “A” End if
2.if (the number is between 70 and 79, inclusive)
then
1. Set the grade to “B” End if
Continues on the next slide
Solution
24
FARZANASHAHICS
25. z
3. if (the number is between 60 and 69,
inclusive) then
3.1 Set the grade to “C” End if
4. if (the number is between 50 and 59, inclusive)
then
1. Set the grade to “D” End if
5. If (the number is less than 50) then
1. Set the grade to “F” End if
6. Return the grade End
25
FARZANASHAHICS
26. z
PSEUDOCODE & ALGORITHM
FARZANASHAHICS
26
Example : 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.
EXAMPLE 4
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”
27. z
DetailedAlgorithm
Step 1:
Step 2:
Step 3:
Input M1,M2,M3,M4
GRADE (M1+M2+M3+M4)/4
if (GRADE < 50) then Print
“FAIL” else
Print “PASS”
endif
PSEUDOCODE & ALGORITHM
FARZANASHAHICS
27