Download presentation
Presentation is loading. Please wait.
Published byMeghan Debra Evans Modified over 8 years ago
1
Algorithms in Programming Computer Science Principles LO 5.1.1
2
What is an algorithm How do you get here: from here: Write your algorithm now!
3
How does Google do it? Map and directions – which way: http://goo.gl/maps/ENZyZ What is Google maps doing? http://www.google.com/patents/US7054745
4
More to consider: How do you tie your shoes? Or, brush your teeth? Or, WHATEVER? How do we see these the same and different? These can all be represented by algorithms. Now, how does a computer do it? Using data representation and programming languages!
5
Data representation Binary representation of information – Any information that can be represented by decimal numbers can be represented by binary numbers – 1 or 0 corresponds to on or off – Bits and bytes
6
Languages Low level – Match machine instruction set of microprocessor – Abstract and difficult for humans – generally require less computer memory and run more quickly High level – More easily understood by humans – No one to one to instruction set of microprocessor – portable between different microprocessors
7
Using high level languages Interpreted languages – Require translation program called interpreter – Converts program language into machine instructions as every time the program is run Compiled languages – Complier program translates program source code into an object file – Linker adds machine language to object file to produce executable file – Executable file remains same and can be run many times
8
Advantages of complied languages Executable file stands alone, can be run many times Requires less memory and runs faster than interpreted programs Can be utilized by many computers without additional software Gives program portability NOTE: Programming changes require recompiling and linking to produce new executable file with changes
9
Basic program execution Program instructions converted to machine code are processed by the Central Processing Unit (CPU) – Instructions received from memory – FETCH – Decoded by CPU, directs data to Arithmetic/Logic Unit (ALU) – ALU performs arithmetic or logical task – EXECUTE – ALU stores results and releases output or secondary storage device
10
This is process is repeated many times This process is models von Neumann architecture
11
An algorithm for Big Data MapReduce – Handles many terabytes of data – Partitions data to be handled by many computers in a system (running parallel) – Partitioned data from a machine returns intermediate values (mapping) – Intermediate values are clustered (combined) across machines (reducing) – The reduced data is returned for evaluation, producing trends or predictions
12
Scratch 2.0 Web browser based interpreted language Blocked-based language where many structures are readily available Generally eliminates syntax (programming language requirements) errors Block structures produce the algorithms to complete the tasks of the Scratch program
13
Group programs Draw a square – Iterations Average 3 grades Each member needs these to modify later
14
Individual programs Draw a figure with number of side as a choice Average any number of grades – Conditionals Extension: Add letter grade to average program – if statements Additional practice
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.