Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
Lecture Object oriented programming - Lecture no 25
tailieunhanh - Lecture Object oriented programming - Lecture no 25
In this chapter, we will present several nonnumerical recursive algorithms in this chapter. We will also discuss some criteria for deciding when to use recursion and when not to. All the recursive algorithms we provide in this chapter, other than those we use for explanation, are algorithms that should be written recursively. | CSC241: Object Oriented Programming Lecture No 25 Previous Lecture Example programs Publication company Two derived classes Book and Tape Polymorphic behavior: Virtual function Distance class Overloaded * operator Friend version of member function required one more argument Today’s Lecture Intro to Generic Programming Template Function template Class template Generic programming There are situations where same algorithms works for different data type Suppose a function that returns the maximum of two numbers Same algorithm (to find the max number) works with integers and real numbers Until now we have to write two separate function int max (int, int); float max (float, float); Through generic programming we can have just one function to find max of int or float or any other type of values Cont. Generic programming is a style of computer programming in which algorithms are written in terms of to-be-specified-later types that are then instantiated when needed for specific types provided | CSC241: Object Oriented Programming Lecture No 25 Previous Lecture Example programs Publication company Two derived classes Book and Tape Polymorphic behavior: Virtual function Distance class Overloaded * operator Friend version of member function required one more argument Today’s Lecture Intro to Generic Programming Template Function template Class template Generic programming There are situations where same algorithms works for different data type Suppose a function that returns the maximum of two numbers Same algorithm (to find the max number) works with integers and real numbers Until now we have to write two separate function int max (int, int); float max (float, float); Through generic programming we can have just one function to find max of int or float or any other type of values Cont. Generic programming is a style of computer programming in which algorithms are written in terms of to-be-specified-later types that are then instantiated when needed for specific types provided as parameter So if max() function is called with int parameter, max function with int parameter is created In C++ generic programming is implemented with “templates Benefit of generic programming Reusability Value Max (Value1, Value2) { if( Value1 > Value2 ) return Value1; else return Value2; } y= Max(15, 67); int Max (int arg1, int arg2) { if( 15 > 67 ) return arg1; else return arg2; } y= Max(, ); int Max (float arg1, float arg2) { if( 15 > 67 ) return arg1; else return arg2; } Templates Templates make it possible to use one function or class to handle many different data types The template concept can be used in two different ways: with functions and with classes A simple function template Suppose we want to write a function that returns the absolute value of two numbers absolute value of a number is its value without regard to its sign: absolute value of 3 is 3 absolute value of –3 is also 3 absolute value of is absolute value of is Why Template .
Yến Mai
95
21
pptx
Báo lỗi
Trùng lắp nội dung
Văn hóa đồi trụy
Phản động
Bản quyền
File lỗi
Khác
Upload
Tải xuống
đang nạp các trang xem trước
Không thể tạo bản xem trước, hãy bấm tải xuống
Tải xuống
TÀI LIỆU LIÊN QUAN
TÀI LIỆU XEM NHIỀU
Một Case Về Hematology (1)
8
461857
55
Giới thiệu :Lập trình mã nguồn mở
14
22603
58
Tiểu luận: Tư tưởng Hồ Chí Minh về xây dựng nhà nước trong sạch vững mạnh
13
10882
529
Câu hỏi và đáp án bài tập tình huống Quản trị học
14
10049
445
Phân tích và làm rõ ý kiến sau: “Bài thơ Tự tình II vừa nói lên bi kịch duyên phận vừa cho thấy khát vọng sống, khát vọng hạnh phúc của Hồ Xuân Hương”
3
9513
104
Ebook Facts and Figures – Basic reading practice: Phần 1 – Đặng Tuấn Anh (Dịch)
249
8268
1124
Tiểu luận: Nội dung tư tưởng Hồ Chí Minh về đạo đức
16
8224
423
Mẫu đơn thông tin ứng viên ngân hàng VIB
8
7862
2220
Đề tài: Dự án kinh doanh thời trang quần áo nữ
17
6669
253
Vật lý hạt cơ bản (1)
29
5765
85
TỪ KHÓA LIÊN QUAN
Kỹ thuật lập trình
Object oriented programming
Programming languages
Lecture Object oriented programming
Lập trình hướng đối tượng
Object oriented programming with Java
C++ programming
C + + Primer Plus
programming techniques
programming tips
teaching C programming
programming in C
C + + programming
Programming principles
Programming C++
Practical C++ programming
The C programming language
C++ interoperability
programming experience
C # programming tips
programming languages
C + + language
curriculum programming
C programming basics
experience in programming
software engineering
computer programming
java programming language C + +
C programming
computer engineering
C sharp
database
programming with C
C programming language
documentation set the
Programming adages
Switch statement
C++ programmers
language C + +
programming language C #
C # programming techniques
programming documents
programming procedure
C + + programming language C + +
C + + Programs to Accompany Programming Logic and Design
office applications
office computing
Windows programming
application programming
Java programming
programming dot Net
C # programming
computer applications
tips for windows 7
computer tips
computer software
code programming
programming basics
programming language
C + +
Visual C + +
Embedded systems programming
Embedded systems
Programming process
Code design
Programming hard
Modular programming
Extern modifier
Array code
History of C++
C++ Programmer
basic programming
PHP programming
programming assignments
programming languages c
code programming c
variables and constants in C
programming technique
fundamental programming language C + + programming experience
C++ for Dummies
Low Level C Programming
introductory programming
C++ Strings
Reading data
C Style Strings
C++ Pre processor
Pre processor surprises
Conditional compilation
K&R style functions
Turning structures classes
Zeroing structures
TÀI LIỆU MỚI ĐĂNG
Động cơ đốt trong và máy kéo công nghiêp tập 2 part 8
32
258
0
24-04-2024
BeginningMac OS X Tiger Dashboard Widget Development 2006 phần 2
34
208
0
24-04-2024
beginning Ubuntu Linux phần 1
34
212
1
24-04-2024
Magnetic Bearings Theory and Applications phần 2
14
170
0
24-04-2024
QUẢN LÝ CHẤT LƯỢNG KHÔNG KHÍ
75
137
0
24-04-2024
Giáo trình tổng quan khoa học thông tin và thư viện part 7
22
143
2
24-04-2024
MẪU GIẤY PHÉP VẬN TẢI LOẠI C
2
107
0
24-04-2024
GYNECOLOGIC CANCERS IN PREGNANCY: GUIDELINES OF AN INTERNATIONAL CONSENSUS MEETING
12
90
0
24-04-2024
Bài giảng hệ điều hành : HỆ ĐIỀU HÀNH NÂNG CAO part 4
6
113
0
24-04-2024
Giáo trình tiếng anh chuyên ngành kỹ thuật phục vụ nhà hàng part 4
35
195
0
24-04-2024
TÀI LIỆU HOT
Mẫu đơn thông tin ứng viên ngân hàng VIB
8
7862
2220
Giáo trình Tư tưởng Hồ Chí Minh - Mạch Quang Thắng (Dành cho bậc ĐH - Không chuyên ngành Lý luận chính trị)
152
5678
1349
Ebook Chào con ba mẹ đã sẵn sàng
112
3757
1230
Ebook Tuyển tập đề bài và bài văn nghị luận xã hội: Phần 1
62
5309
1135
Ebook Facts and Figures – Basic reading practice: Phần 1 – Đặng Tuấn Anh (Dịch)
249
8268
1124
Giáo trình Văn hóa kinh doanh - PGS.TS. Dương Thị Liễu
561
3489
642
Tiểu luận: Tư tưởng Hồ Chí Minh về xây dựng nhà nước trong sạch vững mạnh
13
10882
529
Giáo trình Sinh lí học trẻ em: Phần 1 - TS Lê Thanh Vân
122
3678
525
Giáo trình Pháp luật đại cương: Phần 1 - NXB ĐH Sư Phạm
274
4040
514
Bài tập nhóm quản lý dự án: Dự án xây dựng quán cafe
35
4120
480
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.