algorithms n.
Download
Skip this Video
Download Presentation
ALGORITHMS

Loading in 2 Seconds...

play fullscreen
1 / 23

ALGORITHMS - PowerPoint PPT Presentation


  • 80 Views
  • Uploaded on

ALGORITHMS. CSC 171 LECTURE 1. What is “Computer Science”?. What is “Science”? What is a “Computer”? What is “Computation”?. Computer Science. Is Computer Science, “science”? Is computation part of nature? Is information part of nature? How do we study computation?. SCIENCE.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'ALGORITHMS' - valentine


Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
algorithms

ALGORITHMS

CSC 171

LECTURE 1

what is computer science
What is “Computer Science”?
  • What is “Science”?
  • What is a “Computer”?
  • What is “Computation”?
computer science
Computer Science
  • Is Computer Science, “science”?
  • Is computation part of nature?
  • Is information part of nature?
  • How do we study computation?
history
Muhammad ibn Musa Al'Khowarizmi (ca. 825)

Described rules to be followed for arithmetic using Hindu numerals.

A written process to be followed to achieve some goal

Translated into Latin in 1202 by Leonardo Fibonacci

Al’Khowarazimi -> “Algorithmus”

History
more recent history
More Recent History
  • Charles Babbage (1791-1871)
    • The father of computing
    • Difference Engine & Analytical Engine
  • Ada Lovelace (1815-1852)
    • First programmer
  • John Atanasoff
    • First electronic digital computer 1937-42
  • Maucly & Eckert – 1943-45 - ENIAC
    • First all electronic computer
algorithm
ALGORITHM
  • An algorithm is a procedure for solving problems in terms of :
    • The actions to be executed (statements)
    • The order in which these actions are executed
  • Algorithms are independent of any specific computer language which may be used to for their implementation.
    • Often expressed informally as pseudocode.
some algorithms
Some Algorithms
  • How do I get to the pit?
    • Your classmate
    • Your parents
    • A robot
      • Move forward x meters
      • Turn right y radians
statements
Statements
  • What do we need for “Statements”
  • Syntax
    • the form in which statements may be written
  • Semantics
    • “meaning” attached to syntactic constructs
example
Example
  • Syntax
    • F = (9/5) * C + 32
    • 2 F 3=+)C 9 * / 5(
  • Semantics
    • Take the Celsius temperature
    • Multiply it by 1.8
    • Add 32
    • The result is the Fahrenheit temperature
how do computers represent information
How do Computers represent information?

Computers are switches

Switches are “on” or “off”

Suppose we want to represent number

We can decide to interpret (semantics)

an “on” switch as a “1”

and an “off” switch as a “0”

language
Language
  • What does language do?
    • Transfer information (describe)
    • Action oriented languages (directions)
    • Functional languages
      • Area = Pi * Radius * Radius
    • Object oriented languages
      • “model” the world around us
programming languages
Programming Languages
  • Three levels of programming languages
    • Low level Machine Languages (binary codes)
    • Assembly Languages (mid level)
      • Symbolic programming
      • Requires an assembler to translate assembly programs into machine program
    • High Level
      • Conceptual programming
      • Requires a compiler to translate high-level languages into assembly level languages
computer languages
Computer Languages
  • To a human we might say:
    • Write: “Hello, CSC 171”
  • To a computer we might say
    • System.out.println(“Hello, CSC 171”);
slide16
JAVA

Java is a high-level object oriented language

Two types of Java programs are

Applets – run with web browsers

Applications – run “stand alone”

a computer program
A Computer Program

public class myFirstProgram {

public static void main(String args[]){

System.out.println(“Hello, CSC171”);

}

}

the containment pattern
The Containment Pattern
  • Starts with some “begin” symbol
    • {([“
  • Ends with some “end” symbol
    • “])}
  • General Pattern <begin>+<contents>+<end>
named containment
Named containment
  • <header> + <containment>
  • <header> + <begin>+<contents>+<end>
a computer program1
A Computer Program

public class myFirstProgram {

public static void main(String args[]){

System.out.println(“Hello, CSC171”);

}

}

errors
ERRORS
  • Syntax errorsSystem.ouch.print("...");System.out.print("Hello);
    • Detected by the compiler
  • Logic errorsSystem.out.print("Hell");
    • Detected (hopefully) through testing
ad