Chapter 6 Questions Quick Quiz

Slides:



Advertisements
Similar presentations
C++ Programming:. Program Design Including
Advertisements

LOOP / REPETITION while loop. for loop do/while loop We assume that loops are not meant to be infinite. That is, there should always be a way out of the.
R ECURSION. O VERVIEW Definition of Recursion Where recursion is used Recursion in Factorial (!n)
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 16: Recursion.
Chapter 10 Recursion. Copyright © 2005 Pearson Addison-Wesley. All rights reserved Chapter Objectives Explain the underlying concepts of recursion.
16/23/2015 9:48 AM6/23/2015 9:48 AM6/23/2015 9:48 AMRecursion Recursion Recursion is when a function calls itself to implement an algorithm. Really a paradigm.
Recursive Algorithms Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Data Structures Using C++1 Chapter 6 Recursion. Data Structures Using C++2 Chapter Objectives Learn about recursive definitions Explore the base case.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 16: Recursion.
1 Algorithm Design Techniques Greedy algorithms Divide and conquer Dynamic programming Randomized algorithms Backtracking.
CHAPTER 10 Recursion. 2 Recursive Thinking Recursion is a programming technique in which a method can call itself to solve a problem A recursive definition.
CS212: DATASTRUCTURES Lecture 3: Recursion 1. Lecture Contents 2  The Concept of Recursion  Why recursion?  Factorial – A case study  Content of a.
Data Structures Using C++ 2E Chapter 6 Recursion.
A Review of Recursion Dr. Jicheng Fu Department of Computer Science University of Central Oklahoma.
1 Chapter 1 RECURSION. 2 Chapter 1  Subprogram implementation  Recursion  Designing Recursive Algorithms  Towers of Hanoi  Backtracking  Eight Queens.
Data Structures Using C++ 2E Chapter 6 Recursion.
Data Structures Using C++1 Chapter 6 Recursion. Data Structures Using C++2 Chapter Objectives Learn about recursive definitions Explore the base case.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 17: Recursion.
Department of Computer Science Data Structures Using C++ 2E Chapter 6: Recursion Learn about recursive Definitions Algorithms Functions Explore the base.
Objective - To solve equations with the variable in both sides.
Computer Science: A Structured Programming Approach Using C1 6-9 Recursion In general, programmers use two approaches to writing repetitive algorithms.
1 CS 132 Spring 2008 Chapter 6 Recursion Read p Skip example 6-3 (Fibonacci), 6-4 (Hanoi) Read example 6-5 (p. 387)
Recursion Textbook chapter Recursive Function Call a recursive call is a function call in which the called function is the same as the one making.
Computer Science Department Data Structure & Algorithms Lecture 8 Recursion.
Chapter 14 Recursion. Chapter Objectives Learn about recursive definitions Explore the base case and the general case of a recursive definition Learn.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 17: Recursion.
Reading – Chapter 10. Recursion The process of solving a problem by reducing it to smaller versions of itself Example: Sierpinski’s TriangleSierpinski’s.
CS212: DATASTRUCTURES Lecture 3: Recursion 1. Lecture Contents 2  The Concept of Recursion  Why recursion?  Factorial – A case study  Content of a.
Lesson 6-3B Objective: Solve inequalities using more than one step…continued.
1 7.Algorithm Efficiency What to measure? Space utilization: amount of memory required  Time efficiency: amount of time required to process the data.
Solving Systems Using Elimination
Edited by Malak Abdullah Jordan University of Science and Technology Data Structures Using C++ 2E Chapter 6 Recursion.
Data Structures R e c u r s i o n. Recursive Thinking Recursion is a problem-solving approach that can be used to generate simple solutions to certain.
Java Programming: Guided Learning with Early Objects Chapter 11 Recursion.
Data Structures Using Java1 Chapter 5 Recursion. Data Structures Using Java2 Chapter Objectives Learn about recursive definitions Explore the base case.
ITEC 109 Lecture 11 While loops. while loops Review Choices –1 st –2 nd to ?th –Last What happens if you only use ifs? Can you have just an else by itself?
Solve the following system using the elimination method.
One Answer, No Answers, or an Infinite Number of Answers.
Recursion. 2 Overview  Learn about recursive definitions  Explore the base case and the general case of a recursive definition  Discover recursive.
Chapter 15: Recursion. Objectives In this chapter, you will: – Learn about recursive definitions – Explore the base case and the general case of a recursive.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 16: Recursion.
3.4 Solving Equations with Variables on Both Sides Objective: Solve equations that have variables on both sides.
1 Copyright © 2015, 2011, 2007 Pearson Education, Inc. Chapter 4-1 Systems of Equations and Inequalities Chapter 4.
W1-1 University of Washington Computer Programming I Recursion © 2000 UW CSE.
Recursion Chapter 17 Instructor: Scott Kristjanson CMPT 125/125 SFU Burnaby, Fall 2013.
COP INTERMEDIATE JAVA Recursion. The term “recursion” refers to the fact that the same computation recurs, or occurs repeatedly, as a problem is.
Holt McDougal Algebra Solving Equations with Variables on Both Sides 1-5 Solving Equations with Variables on Both Sides Holt Algebra 1 Warm Up Warm.
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
Chapter 15: Recursion. Recursive Definitions Recursion: solving a problem by reducing it to smaller versions of itself – Provides a powerful way to solve.
Chapter 15: Recursion. Objectives In this chapter, you will: – Learn about recursive definitions – Explore the base case and the general case of a recursive.
Analysis of Algorithms Spring 2016CS202 - Fundamentals of Computer Science II1.
Identities, Contradictions and Conditional Equations.
CSC 143 P 1 CSC 143 Recursion [Chapter 5]. CSC 143 P 2 Recursion  A recursive definition is one which is defined in terms of itself  Example:  Compound.
1 CSC 143 Recursion [Reading: Chapter 17]. 2 Recursion  A recursive definition is one which is defined in terms of itself.  Example:  Sum of the first.
1 Dr. Chow-Sing LinRecursion - CH 10 Problem Solving and Program Design in C Chapter 9 Recursion Chow-Sing Lin.
Chapter 15 Recursion.
Chapter 15 Recursion.
Data Structures Using Java
Loops in C C has three loop statements: the while, the for, and the do…while. The first two are pretest loops, and the the third is a post-test loop. We.
Recursion Chapter 11.
Recursion Data Structures.
Objective Solve equations in one variable that contain variable terms on both sides.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 17: Recursion.
Question How do you solve a system of simultaneous equations by substitution?
SECTION 2-4 : SOLVING EQUATIONS WITH THE VARIABLE ON BOTH SIDES
Objective Solve equations in one variable that contain variable terms on both sides.
CSC 143 Recursion.
The structure of programming
The structure of programming
Thinking procedurally
Presentation transcript:

Chapter 6 Questions Quick Quiz   True or False: Every (recursive) call also has its own set of parameters and local variables. Answer: True If every recursive call results in another recursive call, then the recursive function (algorithm) is said to have ____ recursion. Answer: infinite

Questions Every recursive definition must have at least ____ base case(s). Answer: one   True or False: If a recursive solution to a problem exists, a programmer should always opt to use it over any iterative solution that exists. Answer: False

Questions ____ control structures use a looping structure to repeat a set of statements. Answer: Iterative   Every ____ call requires that the system allocate memory space for its formal parameters and local variables and then deallocate the memory space when the function exits. Answer: recursive

Questions True or False: It is difficult to construct an iterative solution for the Tower of Hanoi problem. Answer: True   The ____ algorithm attempts to find solutions to a problem by constructing partial solutions and then making sure that any partial solution does not violate the problem requirements. Answer: backtracking

Questions A function is called ____ recursive if it calls itself.   A function is called ____ recursive if it calls itself. Answer: directly

Text   True or False: There are usually two ways to solve a particular problem: iteration and recursion. Answer: True