Professional Documents
Culture Documents
Slide 4 Xem
Slide 4 Xem
GIẢI THUẬT
S=1+2+…+n, P=n!=n(n-1)…1
… function(…){
if(suy biến) long Tong(int n){
return …; if(n==1) return 1;
else else return Tong(n-1)+n;
return function(…); }
long Fac(int n){
} if(n==0) return 1;
else return Fac(n-1)*n;
}
4.2. TÌM KIẾM TUẦN TỰ: LẶP ĐỆ QUY
Memory Complexity
(Worst)
1. Sử dụng Timing Class để
tính thời gian thực thi của
các thuật toán nêu trên.
BÀI TẬP
2. Cài đặt các thuật toán
Note: Timing class trên LMS
tìm kiếm nêu trên với lớp
SinhVien(id, hoten,
diemtb)