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 note Data visualization - Chapter 8
Đang chuẩn bị liên kết để tải về tài liệu:
Lecture note Data visualization - Chapter 8
Việt Phương
116
21
pptx
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
This chapter presents the following content: Data structures and problems with C, pointers, arrays and structures, types of arrays, use of vectors. | Lecture 08 Recap Data Structures and Problems with C Pointers Arrays and Structures Types of Arrays Use of Vectors Resizing the Vector One limitation of primitive arrays is that, once they have been declared, their size can never change However, we can use resize to change the size of a vector Pointers are used to give the illusion of an array that can be resized Example arr is representing a 10-element vector Somewhere, buried in the implementation then, memory is allocated for 10 elements Suppose that we would like to expand this memory to 12 elements The problem is that array elements must be stored in contiguous memory and that the memory immediately following arr might already be taken Continued . Do the following We remember where the memory for the 10-element array is (the purpose of original) We create a new 12-element array and have arr use it. We copy the 10 elements from original to arr; the two extra elements in the new arr have some default value We inform the system . | Lecture 08 Recap Data Structures and Problems with C Pointers Arrays and Structures Types of Arrays Use of Vectors Resizing the Vector One limitation of primitive arrays is that, once they have been declared, their size can never change However, we can use resize to change the size of a vector Pointers are used to give the illusion of an array that can be resized Example arr is representing a 10-element vector Somewhere, buried in the implementation then, memory is allocated for 10 elements Suppose that we would like to expand this memory to 12 elements The problem is that array elements must be stored in contiguous memory and that the memory immediately following arr might already be taken Continued . Do the following We remember where the memory for the 10-element array is (the purpose of original) We create a new 12-element array and have arr use it. We copy the 10 elements from original to arr; the two extra elements in the new arr have some default value We inform the system that the 10-element array can be reused as it sees fit Resizing Continued . Array expansion is implemented in some multiplicative constant times as large We might expand to make it twice as large When we expand the array from N items to 2N items, the cost of the N copies can be apportioned over the next N items that can be inserted into the array without an expansion this dynamic expansion is only negligibly more expensive than starting with a fixed size, but it is much more flexible push_back function The push-back function increases the size by one, and adds a new item into the array at the appropriate position This is a trivial operation if capacity has not been reached If it has, the capacity is automatically expanded, using the strategy described in previous topic Parameter-Passing Mechanism Three mechanism Call by Value Call by Reference Call by Constant Reference Call by Value Default parameter passing mechanism Natural declaration to pass a vector to a routine that finds the .
TÀI LIỆU LIÊN QUAN
Lecture note Data visualization - Chapter 1: Introduction to Data Visualization
Lecture note Data visualization - Chapter 1
Lecture note Data visualization - Chapter 2
Lecture note Data visualization - Chapter 3
Lecture note Data visualization - Chapter 4
Lecture note Data visualization - Chapter 5
Lecture note Data visualization - Chapter 6
Lecture note Data visualization - Chapter 7
Lecture note Data visualization - Chapter 8
Lecture note Data visualization - Chapter 9
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.