Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
144 views

Algorithm and Problem Solving

The document discusses algorithms and their key characteristics: they must be effective by finding an answer in a finite number of steps, and can be thought of as a set of instructions to complete a task like a recipe. It provides an example of baking a cake. It also discusses problem solving processes like understanding the problem, describing the data and algorithms, implementing a program, testing and debugging. Big data is characterized as having high volume, velocity and variety. The document outlines variables and identifiers, operators, taking input, and provides an example practice problem of converting euros to eurocents.

Uploaded by

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

Algorithm and Problem Solving

The document discusses algorithms and their key characteristics: they must be effective by finding an answer in a finite number of steps, and can be thought of as a set of instructions to complete a task like a recipe. It provides an example of baking a cake. It also discusses problem solving processes like understanding the problem, describing the data and algorithms, implementing a program, testing and debugging. Big data is characterized as having high volume, velocity and variety. The document outlines variables and identifiers, operators, taking input, and provides an example practice problem of converting euros to eurocents.

Uploaded by

Ovidiu Smocot
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Algorithm

• It is effective, which means that an answer is found and it


finishes, that is it has a finite number of steps.

• We can think of an algorithm as a set of instructions which


we must follow in order to complete a task successfully.

• An example is a recipe that we must follow when baking a


cake.
Algorithms & Problem Solving
• Problem Solving Process
•Clear understanding • There may be many possible
Analyse •What constitutes a solution
Problem solutions
• There may be many possible ways
•What are the datatypes?
•How is the data structured?
of representing the data in our
Describe Data
& Algorithms •Create appropriate algorithms program
• There are different types of
•Represent data algorithmic approaches that can
Implement
Program
•Implement algorithms be taken depending on the
problem at hand
•Create test cases
• BUGS will exist – they can be
Test & Debug
•Fix any bugs difficult to eradicate!

17/09/2018 Programming for BIG Data 2


Big Data
• Gartner’s Doug Laney published report in 2001 stating the 3 V’s for Big Data
• High Volume
• High Velocity
• High Variety

• Based on the concept of Doug Mashey from Silicon Graphics in the mid-90s
Variables & Identifiers
• Keyword Identifiers

• A keyword identifier has a pre-defined meaning in a programming language


Python 2.75 has
31 keywords

17/09/2018 Programming for BIG Data 4


2.3 Variables & Identifiers
• Other Identifiers

• Python also has some other predefined identifiers that can be used as variable name
identifiers but should not be!!
• print
• exit
• quit
• float
• int

• The opposite command examples


illustrate how to check if an
identifier is a
predefined identifier in Python

17/09/2018 Programming for BIG Data 5


Operators
Operator Description Example Result
+ Addition 2 + 3 5
- Subtration (binary 3 - 2 1
operator)

- Negation (unary -3 -3
operator)

* Multiplication 7*5 35
/ Division 5/3 1
% Modulus 34 % 2 0
// Truncated Division 6//4.0 1.0
** Exponentiation 2**3 8

The result of truncated division will depend on the datatypes of


the operands. The resultant value will be a whole number
equivalent represented as either an integer or a float.

17/09/2018 Programming for BIG Data 6


Input & Raw Input
• input(“Enter a number?”)

• amount = raw_input(“Please enter an amount?”)


• cent_amount = amount * 100
• print(cent_amount)
Practice, Practice, Practice
• Write a Python Program that transforms EUR in EURCENT. The
amount of EUR is given as input and the amount of EUROCENTs is
printed as output.

• E.g., if the program will take as input 1 EUR will give as output 100 EURCENTs
• E.g., if the program will take as input 5 EUR will give as output 500 EURCENTs
Summary
• Algorithm
• Algorithms & Problem Solving
• Big Data
• Variables & Identifiers
• Operators
• Input & Raw Input
• Practice

You might also like