Danh mục

Bài giảng Nhập môn lập trình: Contiguous Storage - Võ Quang Hoàng Khang

Số trang: 51      Loại file: pdf      Dung lượng: 1.36 MB      Lượt xem: 10      Lượt tải: 0    
Jamona

Hỗ trợ phí lưu trữ khi tải xuống: 32,000 VND Tải xuống file đầy đủ (51 trang) 0

Báo xấu

Xem trước 6 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

Bài giảng Nhập môn lập trình: Contiguous Storage cung cấp nội dung chính như: Introduction to contiguous storage, arrays, one-dimensional Arrays, declaration, memory Allocation, initialization accessing elements, traversing, arrays are parameters of functions, searching, sorting,...
Nội dung trích xuất từ tài liệu:
Bài giảng Nhập môn lập trình: Contiguous Storage - Võ Quang Hoàng KhangNHẬP MÔN LẬP TRÌNHContiguous StorageArrays, Simple Data StructureContiguous StorageSearchingSortingNHẬP MÔN LẬP TRÌNHObjectives• How to manage a group of data?– Store– Input– Output– Search– Sort–…Contiguous Storage2NHẬP MÔN LẬP TRÌNHContent• Introduction to contiguous storage• Arrays• One-dimensional Arrays––––––––DeclarationMemory AllocationInitializationAccessing elementsTraversing1-D Arrays are parameters of functionsSearchingSorting• 2-D ArraysContiguous Storage3NHẬP MÔN LẬP TRÌNH1- Contiguous Storage• Commonly, a group of the same meaning elements areconsidered.• They are stored in a contiguous block of memory.• Ex: Group of 10 int numbers  40 bytes block isneeded.• Data are considered can be a group of some items whichbelong to some different data types  Contiguousmemory block is partitioned into some parts which havedifferent size, one part for an item.• Data structure: A structure of data stored.• Array is the simplest data structure which contains someitems which belong to the same data type.• Common used operations on a group: Add, Search,Remove, Update, SortContiguous Storage4NHẬP MÔN LẬP TRÌNH2- ArraysArray: A groupof elementswhich belong tothe same datatype. Eachelement isidentified by it’sposition(index).indexa(array)051428315490a[3]element5276347218152980a[i] is an integercolumnmm[1][3]row• Dimension: Direction that is used to perform an action on array.• Number of dimensions: Number of indexes are used to specifyan element.• Common arrays: 1-D and 2-D arrays.• Name of an array: An array has it’s name.Contiguous Storage5

Tài liệu được xem nhiều: