1. Trang chủ
  2. » Công Nghệ Thông Tin

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

37 48 0

Đ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: 11/01/2020, 18:46

Xem thêm:

Mục lục

    Counting Digits in Java

    Evaluating Exponents Using Divide and Conquer

    Selection Sort Helper Function

    Insertion Sort Helper Function

    Constructing a Linked List

    Constructing a Linked List from Input

    Converting List to String

    Retrieving nth List Element

    Adding Element to End of List

    Adding Element to List in Order

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN