(Assignment due: Wed. Feb. 04, 2004)

Slides:



Advertisements
Similar presentations
CS Fall 2012, Lab 01 Haohan Zhu. Boston University Slideshow Title Goes Here CS Fall 2012, Lab /17/2015 Using Piazza 
Advertisements

CS223 Advanced Data Structures and Algorithms 1 Divide and Conquer Neil Tang 4/15/2010.
Main Index Contents 11 Main Index Contents Week 10 – Recursive Algorithms.
CS107 Introduction to Computer Science Loops. Instructions Pseudocode Assign values to variables using basic arithmetic operations x = 3 y = x/10 z =
Java Programming (Chapter 1). Java Programming Classes, Types, and Objects.
Scott Grissom, copyright 2004 Chapter 5 Slide 1 Analysis of Algorithms (Ch 5) Chapter 5 focuses on: algorithm analysis searching algorithms sorting algorithms.
COMS W1004 Introduction to Computer Science June 1, 2009.
Jan Art of Programming Yangjun Chen Dept. Business Computing University of Winnipeg.
Basic Building Blocks of Programming. Variables and Assignment Think of a variable as an empty container Assignment symbol (=) means putting a value into.
Selection Sort
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 10: Recursion Problem Solving and Program Design in C 5th Edition.
(a) (b) (c) (d). What is (1,2,3)  (3,4,2)? (a) (1, 2, 3, 4) (b) (1,2)  (3,4) (c) (1,3,4,2) (d) (3,1)  (4,2)
Recursion.
1 Design and Analysis of Algorithms تصميم وتحليل الخوارزميات (311 عال) Chapter 1 Introduction to Algorithms.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the basic concepts and uses of arrays ❏ To be able to define C.
3.1 Evaluate nth Roots and Use Rational Exponents p. 166 What is a quick way to tell what kind of real roots you have? How do you write a radical in exponent.
COM S 207 While-Loop Statement Instructor: Ying Cai Department of Computer Science Iowa State University
1 R. Johnsonbaugh, Discrete Mathematics Chapter 4 Algorithms.
Algorithmic Recursion. Recursion Alongside the algorithm, recursion is one of the most important and fundamental concepts in computer science as well.
Recursive. 2 Recursive Definitions In a recursive definition, an object is defined in terms of itself. We can recursively define sequences, functions.
Copyright © 2011 Pearson Education, Inc. Sequences Section 8.1 Sequences, Series, and Probability.
Lecture#16 Discrete Mathematics. Recursion Now, 1 is an odd positive integer by the definition base. With k = 1, = 3, so 3 is an odd positive integer.
Recursion Concepts Implementation Data Structures and Algorithms in Java, Third EditionCh05 – 1.
Textbook Problem Java – An Introduction to Problem Solving & Programming, Walter Savitch, pp.219, Problem 08.
I CAN COMPARE AND ORDER RATIONAL NUMBERS BY USING A NUMBER LINE. 1.5 RATIONAL NUMBERS.
Answers to Assignment #1 (Assignment due: Wed. Feb. 05, 2003) 1. What does the "plateform independence" mean? How is it implemented in Java? 2. Summarize.
Selection Sort
Data Abstraction and Problem Solving with JAVA Walls and Mirrors Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Data Abstraction and Problem.
Recursion Chapter 11. How it works “A recursive computation solves a problem by using the solution of the same problem with simpler inputs” Big Java,
Recursion A recursive definition is one which uses the word or concept being defined in the definition itself Example: “A computer is a machine.
Introduction to Computing Concepts Note Set 14. What if… You had to print “I love Java” to the screen 125 times. How? 125 lines of ▫ System.out.println(“I.
DATA STRUCTURES (CS212D) Overview & Review Instructor Information 2  Instructor Information:  Dr. Radwa El Shawi  Room: 
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 39 – Command Line Args & Recursion Webpage:
Computer Programming 12 Mr. Jean March 5 th, 2014.
CPSC 233 Tutorial 5 February 2 th /3 th, Java Loop Statements A portion of a program that repeats a statement or a group of statements is called.
JAVA: An Introduction to Problem Solving & Programming, 7 th Ed. By Walter Savitch ISBN © 2015 Pearson Education, Inc., Upper Saddle River,
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
1 Recursive Definitions and Structural Induction CS/APMA 202 Rosen section 3.4 Aaron Bloomfield.
ITI 1120 Lab #8 Contributors: Diana Inkpen, Daniel Amyot, Sylvia Boyd, Amy Felty, Romelia Plesa, Alan Williams.
JAVA: An Introduction to Problem Solving & Programming, 6 th Ed. By Walter Savitch ISBN © 2012 Pearson Education, Inc., Upper Saddle River,
Fundamentals of Java: AP Computer Science Essentials, 4th Edition
Exercise : Write a program that print the final price of purchase at a store where everything costs exactly one dollar. Ask for the number of items purchased.
Chapter 10 Recursion Instructor: Yuksel / Demirer.
COP2800 – Computer Programming Using JAVA
Topic: Python’s building blocks -> Variables, Values, and Types
ASSIGNMENT NO.-2.
Data Structures (CS212D) Overview & Review.
For Monday Read WebCT quiz 18.
Warm-Up Fill in the tables below for each INPUT-OUTPUT rule. 3)
Median Finding and Quick Sort
PC02 Term 2 Test Recursion and Sorting. PC02 Term 2 Test Recursion and Sorting.
Computers & Programming Languages
CSC 113: Computer programming II
Chapter 8 Arrays Objectives
Chapter (3) - Looping Questions.
Cs212: DataStructures Computer Science Department Lab 3 : Recursion.
IT 4043 Data Structures and Algorithms
Aim: What is the sequence?
Class Examples.
Chapter 10: Recursion Problem Solving and Program Design in C 5th Edition by Jeri R. Hanly and Elliot B. Koffman.
Recursion Chapter 11.
Data Structures (CS212D) Overview & Review.
Suppose I want to add all the even integers from 1 to 100 (inclusive)
Figure 4.1 a) A linked list of integers; b) insertion; c) deletion.
See requirements for practice program on next slide.
Chapter 8 Arrays Objectives
Divide and Conquer Neil Tang 4/24/2008
1.4 ทบทวน JAVA OO Programming Concepts Declaring and Creating Objects
CS 1111 Introduction to Programming Spring 2019
Presentation transcript:

(Assignment due: Wed. Feb. 04, 2004) 1.(10) What does the "plateform independence" mean? How is it implemented in Java? 2.(10) Summarize the basic concepts used in Java, such as class, method, variable, Constructor, ... (as many as possible) 3.(25) Write a program that reads in an integer number and prints the following output as long as the number is odd and greater than 0 and less than 10. For example, if the number entered is 9, print: 1 3 3 3 5 5 5 5 5 7 7 7 7 7 7 7 9 9 9 9 9 9 9 9 9

(Assignment due: Wed. Feb. 04, 2004) 4.(25) Write a recursive method called computeFN which computes the following function for values of N: f(N) = 3*f(N-3) + 4*f(N-2) - 5*f(N-1) where f(0) = 1, f(1) = 1, f(2) = 3. 5.(30) Implement ”quick sort" and sort a sequence containing 20 integers: 3, 4, 6, 1, 10, 9, 5, 20, 19, 18, 17, 2, 1, 14, 13, 12, 11, 8, 16, 15. Trace 10 steps of the computation.