-an ordered collection of data elements (data structure), accessed by index and uses a single name/identifier
-Takes up contiguous memory/storage space
Info which needs to be provided when declaring an array:
-Name/identifier
-Size (it's a static data structure)
-Number of dimensions
-Data type
Stack
Stack- is a LIFO (Last In, First Out) data structure. Data is added on the top of a stack and removed from the top, hence LIFO.
Push- to add data/ push onto a stack. First it checks the stack isn't full, then the pointer is incremented and the data inserted
Queue
A queue is a FIFO (first in first out) data structure. Data is added to the rear of the queue (enqueued) and deleted (dequeued) from the front
Record
AKA struct
A record uses one name/identifier to store multiple values in fields which can be different data types
players=("John",True,12)
recordStructure: recordname
fieldName : datatype
end recordStructure
Lists and tuples
Oops! Ang larawang ito ay hindi sumusunod sa aming mga alituntunin sa nilalaman. Upang magpatuloy sa pag-publish, subukan itong alisin o mag-upload ng bago.
Dictionary
dictname={key:value, key:value}
Oops! Ang larawang ito ay hindi sumusunod sa aming mga alituntunin sa nilalaman. Upang magpatuloy sa pag-publish, subukan itong alisin o mag-upload ng bago.