Introduction - University of Alabama at Birmingham

Download Report

Transcript Introduction - University of Alabama at Birmingham

Introduction
Roadmap to Programming
work, right, fast
KISS
7/21/2015
CS 303 – Introducton
Lecture 2
1
A Roadmap to Programming (0)
Mathematical Model
Abstract Data Types
Data Structures
Informal Algorithm
Pseudo-code
Code
Mathematical Model (Graph, Tree, Set, List, ...)
Strips away unimportant details
may show that this problem is just like some other problem
(already solved? known to be hard?
Informal Algorithm
Sketch of a program; overall control structure
Operates on Mathematical Model
7/21/2015
CS 303 – Introducton
Lecture 2
2
A Roadmap to Programming (1)
Mathematical Model
Abstract Data Types
Data Structures
Informal Algorithm
Pseudo-code
Code
Abstract Data Types
Mathematical Model
Operations from Informal Algorithm
Pseudo-Code
Almost compiles
No resource allocation
To be read by humans!
7/21/2015
CS 303 – Introducton
Lecture 2
3
A Roadmap to Programming (2)
Mathematical Model
Abstract Data Types
Data Structures
Informal Algorithm
Pseudo-code
Code
Data Structures
Representation details
Resource (storage) allocation
Code
Compiles!
Executes!
7/21/2015
CS 303 – Introducton
Lecture 2
4
Criteria
Easy to:
Understand
Code
Debug
Efficient use of Resources
User
Programmer
Computer
7/21/2015
CS 303 – Introducton
Lecture 2
5
Method - KISS
KISS – Keep It Simple, Stupid!
Make it:
Work
Compiles, Executes
Right
Gets the right answer
Fast
Input (size, conditioning)
Algorithm Complexity
Speed of hardware
Quality of coding
7/21/2015
CS 303 – Introducton
Lecture 2
6