Visit for more Learning Resources

Slides:



Advertisements
Similar presentations
Etter/Ingber Engineering Problem Solving with C Fundamental Concepts Chapter 4 Modular Programming with Functions.
Advertisements

CSCE 3110 Data Structures & Algorithm Analysis
Programming In C++ Spring Semester 2013 Lecture 3 Programming In C++, Lecture 3 By Umer Rana.
MATH 224 – Discrete Mathematics
Write a program step by step. Step 1: Problem definition. Given the coordinate of two points in 2-D space, compute and print their straight distance.
Modular Programming With Functions
CHAPTER 2 ALGORITHM ANALYSIS 【 Definition 】 An algorithm is a finite set of instructions that, if followed, accomplishes a particular task. In addition,
Making Choices in C if/else statement logical operators break and continue statements switch statement the conditional operator.
Engineering EG167C - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect M1 P. 1Winter Quarter Midterm I Review.
C++ Basics March 10th. A C++ program //if necessary include headers //#include void main() { //variable declaration //read values input from user //computation.
What is a pointer? First of all, it is a variable, just like other variables you studied So it has type, storage etc. Difference: it can only store the.
PSEUDOCODE & FLOW CHART
Programming Logic and Design Fourth Edition, Introductory
Analysys & Complexity of Algorithms Big Oh Notation.
1 Data Structures Performance Analysis. 2 Fundamental Concepts Some fundamental concepts that you should know: –Dynamic memory allocation. –Recursion.
Software Development Method. Assignments Due – Homework 0, Warmup Reading – Chapter 2 –
Program Design and Development
Data Structures Performance Analysis.
Understanding the Mainline Logical Flow Through a Program (continued)
1 Lab Session-III CSIT-120 Spring 2001 Revising Previous session Data input and output While loop Exercise Limits and Bounds GOTO SLIDE 13 Lab session.
Review Algorithm Analysis Problem Solving Space Complexity
ALGORITHMS AND FLOWCHARTS
CMSC 104, Version 8/061L18Functions1.ppt Functions, Part 1 of 4 Topics Using Predefined Functions Programmer-Defined Functions Using Input Parameters Function.
By: Mr. Baha Hanene Chapter 3. Learning Outcomes We will cover the learning outcome 02 in this chapter i.e. Use basic data-types and input / output in.
© The McGraw-Hill Companies, 2006 Chapter 1 The first step.
1. Reference  2  Algorithm :- Outline the essence of a computational procedure, step by step instructions.  Program :- an.
Programming.
C. – C. Yao Data Structure. C. – C. Yao Chap 1 Basic Concepts.
Data Structures & AlgorithmsIT 0501 Algorithm Analysis I.
CMSC 104, Version 9/011 Incremental Programming Topics Review of Incremental Programming Example of Incremental Programming Reading None.
Agenda  Commenting  Inputting Data from Keyboard (scanf)  Arithmetic Operators  ( ) * / + - %  Order of Operations  Mixing Different Numeric Data.
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.
Lecture 2: Introduction to C Programming. OBJECTIVES In this lecture you will learn:  To use simple input and output statements.  The fundamental data.
NA2204.1jcmt CSE 1320 Intermediate Programming C Program Basics Structure of a program and a function type name (parameters) { /* declarations */ statement;
Chapter 5 Algorithms (2) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
CSC141 Introduction to Computer Programming Teacher: AHMED MUMTAZ MUSTEHSAN Lecture - 6.
CSCI 3133 Programming with C Instructor: Bindra Shrestha University of Houston – Clear Lake.
Computer Programming Control Structure
CS 240 – Computer Programming I Lab Kalpa Gunaratna –
1 Programming a Computer Lecture Ten. 2 Outline  A quick introduction to the programming language C  Introduction to software packages: Matlab for numerical.
Computer Programming for Engineers
ALGORITHMS AND FLOWCHARTS. Why Algorithm is needed? 2 Computer Program ? Set of instructions to perform some specific task Is Program itself a Software.
1 CSC103: Introduction to Computer and Programming Lecture No 9.
CMSC 104, Section 301, Fall Lecture 18, 11/11/02 Functions, Part 1 of 3 Topics Using Predefined Functions Programmer-Defined Functions Using Input.
CC213 Programming Applications Week #2 2 Control Structures Control structures –control the flow of execution in a program or function. Three basic control.
Lecture 3 Computer Programming -1-. The main steps of program development to solve the problem: 1- problem definition : The problem must be defined into.
Arithmetic Instructions. Integer and Float Conversions.
Lecture 2. Algorithms and Algorithm Convention 1.
Unit 3: ALGORITHMS AND FLOWCHARTS
INC 161 , CPE 100 Computer Programming
Lecture – 2 on Data structures
ALGORITHMS AND FLOWCHARTS
Revision Lecture
Getting Started with C.
Functions in C Mrs. Chitra M. Gaikwad.
Visit for more Learning Resources
ALGORITHMS AND FLOWCHARTS
Algorithm.
Variables In programming, we often need to have places to store data. These receptacles are called variables. They are called that because they can change.
Introduction to CS Your First C Programs
Algorithm An algorithm is a finite set of steps required to solve a problem. An algorithm must have following properties: Input: An algorithm must have.
1) C program development 2) Selection structure
ALGORITHMS AND FLOWCHARTS
Analysys & Complexity of Algorithms
Revision of C++.
Introduction to Algorithm and its Complexity Lecture 1: 18 slides
In C Programming Language
Introduction to C Programming
EPSII 59:006 Spring 2004.
Presentation transcript:

Visit for more Learning Resources Chapter 1 Visit for more Learning Resources

An Algorithm is a finite set of instructions that if followed accomplishes a particular task.

Finiteness Definiteness Effectiveness Input Output

Name of the algorithm and an introductory Comment. Steps Comments Assignments Statements Exit Statement Variable Name Operators Input and Output Statements Flow Chart

Name of the algorithm and an introductory Comment. LINEAR_SEARCH(A,N,KEY) [ ALGORITHM TO PERFORM LINEAR SEARCH]

Steps 1. …….. 2…….. 3…….

COMMENTS [ ] Comments are written in brackets

Assignments Statements Dot and equal to O= Var o= 45

Exit Statement Exit / finished / end

Variable Name In capital Eg :- VAR1 VAR2

OPERATORS LOGICAL OPERATOR (AND &&,OR ||,NOT !) RELATIONAL OPERATOR (<,>,<=,>=) ARTHEMATIC OPERATOR (+,-,*,/)

Input and Output Statements Read : VAR (SCANF() ) ---- ACCEPT DATA FROM USER Write Message (Printf() --- print data on the screen

Flow Chart

Brute Force Divide and Conquer Dynamic Programming Greedy Algorithm

Space Complexity It is the amount of memory required for that particular algorithm. Time Complexity Deals with the computing time.

void main() { int a; float b,c; c = a+b; printf(“Result = %d”,c) } Space Required = 2+4+4 = 10 bytes.

void main() { int a; --------------- 1 float b,c; --------------- 1 c = a+b; --------------- 1 printf(“Result = %d”,c); ---- 1 } Total Frequency count = 1+1+1+1 = 4

void main() { int a,n; --------------- 1 float b,c; --------------- 1 n = 3 for(i=0;i<=n;i++) --------- n c = a+b+i; --------------- n printf(“Result = %d”,c); ---- n } Total Frequency count = 1+1+n+n+n = 11

For more detail contact us Provides asympostotic upper bound for a given functions Max (O(1),O(n),O(n+1),O(n^2) For more detail contact us