Lecture An introduction to computer science using java (2nd Edition): Chapter 14 - S.N. Kamin, D. Mickunas, E. Reingold

37 25 0
Lecture An introduction to computer science using java (2nd Edition): Chapter 14 - S.N. Kamin, D. Mickunas, E. Reingold

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

In this chapter we will: introduce recursion as a programming technique, show how recursion can be used to simplify the design of complex algorithms, present several well known recursive algorithms (e.g. quicksort, merge sort, Guaussian elmination), introduce the linked list data structure and recursive implementations for several of its methods, present programs for drawing two types of fractal curves.

Chapter 14 Recursion Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N Kamin, D Mickunas, , E Reingold Chapter Preview In this chapter we will: • introduce recursion as a programming technique • show how recursion can be used to simplify the design of complex algorithms • present several well known recursive algorithms (e.g quicksort, merge sort, Guaussian elmination) • introduce the linked list data structure and recursive implementations for several of its methods • present programs for drawing two types of fractal curves Recursion • Basic problem solving technique is to divide a problem into smaller subproblems • These subproblems may also be divided into smaller subproblems • When the subproblems are small enough to solve directly the process stops • A recursive algorithm is a problem solution that has been expressed in terms of two or more easier to solve subproblems Counting Digits • Recursive definition digits(n) = 1 + digits(n/10) if (–9

Ngày đăng: 15/05/2020, 22:51

Mục lục

  • Chapter 14 Recursion

  • Chapter Preview

  • Recursion

  • Counting Digits

  • Counting Digits in Java

  • Slide 6

  • Evaluating Exponents Recurisivley

  • Divide and Conquer

  • Evaluating Exponents Using Divide and Conquer

  • Selection Sort

  • Find Minimum

  • Selection Sort Helper Function

  • Insertion Sort

  • Insert in Order

  • Insertion Sort Helper Function

  • Quicksort Overview

  • Quicksort

  • Partition

  • Partition Helper

  • Median Location

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan