Algorithms and Data types: Introduction Dr. Andrew Wallace PhD BEng(hons) EurIng

Slides:



Advertisements
Similar presentations
User-Defined Functions Like short programs Can operate on their own data Can receive data from callers and return data to callers.
Advertisements

IT 325 OPERATING SYSTEM C programming language. Why use C instead of Java Intermediate-level language:  Low-level features like bit operations  High-level.
MATH 224 – Discrete Mathematics
Chapter 6 Structures By C. Shing ITEC Dept Radford University.
Introduction to Assembly language
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Making Choices in C if/else statement logical operators break and continue statements switch statement the conditional operator.
C++ Basics March 10th. A C++ program //if necessary include headers //#include void main() { //variable declaration //read values input from user //computation.
Algorithms, Lists and Pseudocode Dr. Andrew Wallace PhD BEng(hons) EurIng
Memory and Files Dr. Andrew Wallace PhD BEng(hons) EurIng
CS1010 Programming Methodology
COEN 352 Data structures and Algorithms R. Dssouli.
Starting Out with C++, 3 rd Edition 1 Chapter 1. Introduction to Computers and Programming.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall Office hours: M-F 11:00-11:
Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 3: Primitive Data Types.
Ch. 1: Software Development (Read) 5 Phases of Software Life Cycle: Problem Analysis and Specification Design Implementation (Coding) Testing, Execution.
Program Design and Development
CS1061 C Programming Lecture 4: Indentifiers and Integers A.O’Riordan, 2004.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
. Memory Management. Memory Organization u During run time, variables can be stored in one of three “pools”  Stack  Static heap  Dynamic heap.
Introduction - The Need for Data Structures Data structures organize data –This gives more efficient programs. More powerful computers encourage more complex.
Data Structures and Programming.  John Edgar2.
Data Structures 1- Course Syllabus. 2- Introduction about Data Structures.
Testing Dr. Andrew Wallace PhD BEng(hons) EurIng
Graphs and Sets Dr. Andrew Wallace PhD BEng(hons) EurIng
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
Classes, Objects, Arrays, Collections and Autoboxing Dr. Andrew Wallace PhD BEng(hons) EurIng
CIS Computer Programming Logic
PRIMITIVE DATA TYPES -Integer -Floating Point -Decimal -Boolean -Character STRINGS -Character Array -Class -String Length -Static -Limited Dynamic -Dynamic.
C Tokens Identifiers Keywords Constants Operators Special symbols.
Introduction. 2COMPSCI Computer Science Fundamentals.
CS212: DATA STRUCTURES Lecture 1: Introduction. What is this course is about ?  Data structures : conceptual and concrete ways to organize data for efficient.
Prepared By Ms.R.K.Dharme Head Computer Department.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
Objects, Classes and Syntax Dr. Andrew Wallace PhD BEng(hons) EurIng
Data Structures and Algorithms Introduction to Algorithms M. B. Fayek CUFE 2006.
The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the.
Documentation Dr. Andrew Wallace PhD BEng(hons) EurIng
The basics of the programming process The development of programming languages to improve software development Programming languages that the average user.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
C LANGUAGE Characteristics of C · Small size
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Higher Computing Science 2016 Prelim Revision. Topics to revise Computational Constructs parameter passing (value and reference, formal and actual) sub-programs/routines,
Chapter 1 Java Programming Review. Introduction Java is platform-independent, meaning that you can write a program once and run it anywhere. Java programs.
Programming. Exam Validation 1-10 Technical words such as Method of validation Do not use “Something”.
CPSC 233 Tutorial 5 February 9 th /10 th, Java Classes Each Java class contains a set of instance variables and methods Instance Variables: Type.
 Data Type is a basic classification which identifies different types of data.  Data Types helps in: › Determining the possible values of a variable.
Mid-Year Review. Coding Problems In general, solve the coding problems by doing it piece by piece. Makes it easier to think about Break parts of code.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Introduction to Data Structure and Algorithms
Lecture 1 Data Structures Aamir Zia. Introduction Course outline Rules and regulations Course contents Good Programming Practices Data Types and Data.
Introduction toData structures and Algorithms
Overview Working directly with memory locations is beneficial. In C, pointers allow you to: change values passed as arguments to functions work directly.
C++ Lesson 1.
Asst.Prof.Dr. Tayfun ÖZGÜR
Basic concepts of C++ Presented by Prof. Satyajit De
Data Structures 1st Week
Chapter 1. Introduction to Computers and Programming
Lesson Outcomes Be able to identify differentiate between types of error in programs Be able to interpret error messages and identify, locate.
פרטים נוספים בסילבוס של הקורס
פרטים נוספים בסילבוס של הקורס
The Programming Process
Introduction to Data Structure
Revision of C++.
Programming Language C Language.
COP3530- Data Structures Introduction
CSE 1020:Software Development
design OO words Debug Variables Data types
Subtype Substitution Principle
Variables and Constants
Presentation transcript:

Algorithms and Data types: Introduction Dr. Andrew Wallace PhD BEng(hons) EurIng

Overview Algorithms Data types Program design Writing code Testing code

Algorithms What is an algorithm? Set of instructions for calculating / doing something. Examples Sorting Path finding Item finding Controlling

Algorithms History Abū ʿ Abdallāh Mu ḥ ammad ibn Mūsā al-Khwārizmī Brahmagupta 0628 Algoritmi de numero Indorum. Anthyphairesis Euclidean algorithm Euclid's Elements Gottfried Wilhelm von Leibniz Calculus ratiocinator 1680 Augusta Ada King, Countess of Lovelace 19 th Cent.

Algorithms Time and space complexity Analysis Pseudocode Design

Data Types What is a data type? A way of classifying pieces of information Useful for computers Examples Primitive Integers, reals, boolean(?) Composite Arrays, struct, unions Abstract Stacks, queues, heaps, trees

Data Types Integers int nVar; short intnVar; long intlVar; unsigned intlVar; intnArray[nSize];

Data Types Floats / doubles floatfVar; doubledVar; long doubledVar;

Data Types Char charcVar; signed charcVar; charstrArray[nSize];

Data Types Void void*pVar;

Program design The ideal way: Customer specification Program / top level specification Top level design Low level design Implementation

Program design Customer specification From the users point of view What to do but not how Program / top level specification Technical What to do but not how!!!

Program design Top level design Modelling the system What data? What functions / methods? How to solve the problem?

Program design Top level design Structured Analysis / Structured design Data flow Object orientated Encapsulation Agents design Task orientated

Program design Low level design Function design KISS Does one thing! Algorithm design Pseudocode

Program design Program boundary Program Input Output check function

Program design int function (n) check n if error return error else do something clever return 0

Program design int function (n) ASSERT(n) do something clever return 0

Writing code Hungarian notation Block structure

Writing code n – integer nVar l – long lVar f – floatfVar d – doubledVar b – BooleanbVar m_- memberm_nVar o – ObjectoVar fp, i, j

Writing code Blocks { } Indentation if … else while.. for …

Testing code Does it meet the requirements? Time constraints Space constraints Does it work (bugs?) Usability

Testing code Block / function test Assembly / integration test Customer / validation testing function Assembly system

Testing code Static Asymptotic analysis Logical proof checking Dynamic Running the code debugger

Testing code Debugging Break points Check variables Change variables Jump in and out of code Step through code Look at the memory

Questions?