1. Trang chủ
  2. » Giáo án - Bài giảng

Bài giảng cấu trúc dữ liệu và giải thuật tìm giai thừa bằng đệ qui TS đào nam anh

21 134 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

Thông tin cơ bản

Định dạng
Số trang 21
Dung lượng 743,2 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Data Structure and Algorithm 1CẤU TRÚC DỮ LIỆU VÀ GIẢI THUẬT Tìm giai thừa bằng đệ qui Dr.. Data Structure and Algorithm 2Wayne, edit by Dao Nam Anh.. Major Reference: • Robert Sedgewick

Trang 1

Data Structure and Algorithm 1

CẤU TRÚC DỮ LIỆU VÀ GIẢI THUẬT

Tìm giai thừa bằng đệ qui

Dr Dao Nam Anh

Trang 2

Data Structure and Algorithm 2

Wayne, edit by Dao Nam Anh

Major Reference:

• Robert Sedgewick, and Kevin Wayne, “Algorithms”

Princeton University, 2011, Addison Wesley

• Algorithm in C (Parts 1-5 Bundle)- Third Edition by

Robert Sedgewick, Addison-Wesley

• Cấu trúc dữ liệu và giải thuật, Đinh Mạnh Tường.

Sư Phạm, 2002

Trang 3

Data Structure and Algorithm 3

pubic class Factorial {

public static int fact ( int n ) {

if ( n == 0 ) return 1 ;

else return n * fact ( n - 1 );

}

public static void main ( String [] args ) {

System out println ( fact ( 3 ));

}

}

Trang 4

Data Structure and Algorithm 4

}

Trang 5

Data Structure and Algorithm 5

}

Trang 6

Data Structure and Algorithm 6

}

Trang 7

Data Structure and Algorithm 7

Trang 8

Data Structure and Algorithm 8

Trang 9

Data Structure and Algorithm 9

Trang 10

Data Structure and Algorithm 10

Trang 11

Data Structure and Algorithm 11

Trang 12

Data Structure and Algorithm 12

Trang 13

Data Structure and Algorithm 13

Trang 14

Data Structure and Algorithm 14

Trang 15

Data Structure and Algorithm 15

Trang 16

Data Structure and Algorithm 16

Trang 17

Data Structure and Algorithm 17

1

Trang 18

Data Structure and Algorithm 18

Trang 19

Data Structure and Algorithm 19

2

Trang 20

Data Structure and Algorithm 20

Trang 21

Data Structure and Algorithm 21

% java Factorial

6

public class Factorial {

public static int fact ( int n ) {

if ( n == 0 ) return 1 ;

else return n * fact ( n - 1 );

}

public static void main ( String [] args ) {

System out println ( fact ( 3 ));

}

}

6

Ngày đăng: 06/11/2017, 12:24

TỪ KHÓA LIÊN QUAN

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

TÀI LIỆU LIÊN QUAN

🧩 Sản phẩm bạn có thể quan tâm