Professional Documents
Culture Documents
CC4 Notes
CC4 Notes
Data Type - Attribute of data; tells compiler how data is to be used; what kind of data can be placed; classifies
various types of data: determine values and type of operations
Built-in Data Type – built-in support
1D array – list, sequence, index as pointer; 2D array – matrix, 2D, row and columns, 3D array – collection of
2D arrays
Row Major (nakahiga) - Address of A[i][j] = baseAddress + w * (i*c+j)
Column Major (nakatayo) - Address of A[i][j] = baseAddress + w * (i+r*j)
Stacks & Queues - Used to collect, arrange, and manipulate data; common way to arrange same data type:
expressions, binary search tree, AVL tree, graph, searching algorithm, sorting algorithm; implemented in 1D
array (list, linked list); cannot be used in multidimensional array
Stack – LIFO; Queue – FIFO
Queue: If p1 == p2: empty; If enqueue: p2++; If dequeue: p1++