CS 112 - Fall 2012, Lab 01 Haohan Zhu. Boston University Slideshow Title Goes Here CS 112 - Fall 2012, Lab 01 2 4/17/2015 Using Piazza 

Slides:



Advertisements
Similar presentations
Introduction to Computer Science Robert Sedgewick and Kevin Wayne Copyright © Recursive GCD Demo public class.
Advertisements

Introduction to Computer Science Robert Sedgewick and Kevin Wayne Recursive Factorial Demo pubic class Factorial {
Finish Strong: Ending your academic semester with success Center for Student Retention and Success A Title III Funded Program.
MATH 224 – Discrete Mathematics
Course Web Site – Also linked from Blackboard Course Materials – Excel Tutorials – Access Tutorials – PPT.
Course Introduction Bryce Boe 2013/06/25 CS24, Summer 2013 C.
CSCI 311 – Algortihms and Data Structures Steve Guattery Dana 335a (department office) x7-3828
CS Fall 2012, Lab 08 Haohan Zhu. Boston University Slideshow Title Goes Here CS Fall 2012, Lab /17/2015 Tree - Data Structure  Basic.
Exception Handling Shirley Moore CS 1401 Spring 2013 cs1401spring2013.pbworks.com May 7,
Cs1120 Fall 2009 David Evans Lecture 16: Power Analysis.
CS1010 Programming Methodology
Programming in Visual Basic
Recursion CS /02/05 L7: Files Slide 2 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved Iteration.
1-1 CMPT 225 Data Structures and Programming Instructor: Aaron Hunter Section: E300 Campus: Harbour Centre Semester: Spring 2007.
CS107 Introduction to Computer Science Loops. Instructions Pseudocode Assign values to variables using basic arithmetic operations x = 3 y = x/10 z =
Wednesday, 12/11/02, Slide #1 CS 106 Intro to Comp. Sci. 1 Wednesday, 12/11/02  QUESTIONS??  Today: CLOSING CEREMONIES!  HW #5 – Back Monday (12/16)
Fall 2008ACS-1805 Ron McFadyen1 Ch 8 Recursion Recursion occurs when a method (or function) calls itself.
CS 206 Introduction to Computer Science II 09 / 03 / 2008 Instructor: Michael Eckmann.
Differential Equations (4/17/06) A differential equation is an equation which contains derivatives within it. More specifically, it is an equation which.
Look Ahead Today – HW#4 out Monday – Regular class (not lab) Tuesday – HW#4 due at 4:45 Wednesday – Last class - return clickers Thursday – Regular office.
CS503: Tenth Lecture, Fall 2008 Review Michael Barnathan.
COMP171 Data Structures and Algorithm Qiang Yang Lecture 1 ( Fall 2006)
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 6 Repetition Statements.
Administrative MUST GO TO CORRECT LAB SECTION! Homework due 11:59pm on Tuesday. 25 points off if late (up to 24 hours) Cannot submit after 11:59pm on Wednesday.
Recitation 1 Programming for Engineers in Python.
1 CS1110 Fall 2011: David Gries & Steve Marschner CS1112: Matlab No prior programming experience One semester of calculus Math- & engineering- type problems.
1.3B MULTIPLYING AND DIVIDING INTEGERS I can multiply and divide integers to solve problems involving integers.
CS 241 – Computer Programming II Lab Kalpa Gunaratna –
MCS 177 Lab Fall 2014 Sept. 2, GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Contact Info Course Instructor: Louis Yu Lab.
Course Introduction CS 2302 SPRING Course Introduction In this part we'll discuss course mechanics. Most of this will apply to all sections of the.
Logic Design CS221 1 st Term combinational circuits Cairo University Faculty of Computers and Information.
Functions and an Introduction to Recursion.  Recursive function ◦ A function that calls itself, either directly, or indirectly (through another function)
CS 241 – Computer Programming II Lab Kalpa Gunaratna –
1 CS 1430: Programming in C++. 2 Literal Values Literal values of int Literal values of float
I CAN COMPARE AND ORDER RATIONAL NUMBERS BY USING A NUMBER LINE. 1.5 RATIONAL NUMBERS.
Number Representation, Data Types and Elementary Programming Shirley Moore CS 1401 February 5-7, 2013.
CompSci 101 Introduction to Computer Science Sept. 9, 2014 Prof. Rodger President Brodhead speech graduation 2010 CompSci 101 Fall
CS Fall 2012, Lab 09 Haohan Zhu. Boston University Slideshow Title Goes Here CS Fall 2012, Lab /20/2015 GUI - Graphical User Interface.
Complexity Bryce Boe 2013/10/21 CS24, Fall Outline Compiler Review Project 1 Questions Complexity (Big-O) C++?
CS 240 – Computer Programming I Lab Kalpa Gunaratna –
CSE8A: Introduction to Programming in Java Fall 2012 Prof. Christine Alvarado cse8afall.weebly.com.
Program Design. The design process How do you go about writing a program? –It’s like many other things in life Understand the problem to be solved Develop.
CS 240 – Computer Programming I Lab Kalpa Gunaratna –
Recursion A recursive definition is one which uses the word or concept being defined in the definition itself Example: “A computer is a machine.
Dr. Sajib Datta CSE Spring 2016 INTERMEDIATE PROGRAMMING.
DATA STRUCTURES (CS212D) Overview & Review Instructor Information 2  Instructor Information:  Dr. Radwa El Shawi  Room: 
CS Fall 2012, Lab 04 Haohan Zhu. Boston University Slideshow Title Goes Here CS Fall 2012, Lab /29/2016 Changes of Office Hours  Monday.
1 ENGI 2420 Structured Programming (Lab Tutorial 2) Memorial University of Newfoundland.
PROBLEM SOLVING AND PROGRAMMING ISMAIL ABUMUHFOUZ | CS 170.
Computer Science 20 Discrete Mathematics for Computer Science 1 All the Math you need for your Computer Science courses that you won’t learn in your Math.
Recursion Chapter 10 Carrano, Data Structures and Abstractions with Java, Second Edition, (c) 2007 Pearson Education, Inc. All rights reserved X.
Presentation Title Subheading goes here.
Fundamentals of Java: AP Computer Science Essentials, 4th Edition
Recursive Algorithms ICS 6D Sandy Irani.
Recursion DRILL: Please take out your notes on Recursion
CS Fall 2012, Lab 02 Haohan Zhu.
Presentation Title Subheading goes here.
Data Structures (CS212D) Overview & Review.
CMSC201 Computer Science I for Majors Lecture 17 – Recursion (cont)
Recursion (part 1) October 24, 2007 ComS 207: Programming I (in Java)
BIOLOGY SEPTEMBER 2013 Opening Assignments.
Data Structures (CS212D) Overview & Review.
Hacettepe University Computer Engineering Department
(Assignment due: Wed. Feb. 04, 2004)
How to succeed in my course, part 1
CS Fall 2012, Lab 11 Haohan Zhu.
CS210- Lecture 3 Jun 6, 2005 Announcements
Main Title Here Topic 2 Topic 3 Topic 4 Topic 5
Presentation transcript:

CS Fall 2012, Lab 01 Haohan Zhu

Boston University Slideshow Title Goes Here CS Fall 2012, Lab /17/2015 Using Piazza   Any question related to the course

Boston University Slideshow Title Goes Here CS Fall 2012, Lab /17/2015 Using WebSubmit   Submit all assignments via WebSubmit

Boston University Slideshow Title Goes Here CS Fall 2012, Lab /17/2015 Lab Sections and Office Hours  Attendence  Office Hours:  Tuesday. 5-6:30 p.m.  Wednesday. 3-4:30 p.m.  Tutoring Hour: 

Boston University Slideshow Title Goes Here CS Fall 2012, Lab /17/2015 Stack and Function  Stack: Last In First Out (LIFO)  Function F1 F2 F1 F2 F3 Call F1 F2 F3 Return F1 F2 F1 Return

Boston University Slideshow Title Goes Here CS Fall 2012, Lab /17/2015 Recursive Function F1 Call F1 Return F1 Return Base Case  Same function, Different variables

Boston University Slideshow Title Goes Here CS Fall 2012, Lab /17/2015 Recursive Function  Base Case (what to do with trivial inputs)  Terminating Conditions  Most logical errors occur at ‘Base Case’  Not only one base case, maybe many cases  Recursive Call (how to solve the problem)  Most difficult part to design a recursive function  Understand which variables are changing, and which are constant.

Boston University Slideshow Title Goes Here CS Fall 2012, Lab /17/2015 Practice  Implementing Exponentiation  Write a function to recursively compute the function f(x,n) = x^n  Compare your results with the built ‐ in java function Math.pow(x, n)  n is a non-negative integer

Boston University Slideshow Title Goes Here CS Fall 2012, Lab /17/2015 Practice  Consider f(x,n) = x^(n/2) * x^(n/2)  What do you need to do if n is odd?  Count number of recursive calls  Count time by using: System.nanoTime()