1/8
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress

What is an array?
An array is a data structure consisting of a collection of elements, each identified by an index or key. It is holds multiple pieces of data contiguously (in a row) and is stored in main memory. Its values are mutable and the values can be changed during runtime. It can be a static data structure its length can’t change during run time.
Pros of an array
Good for storing many types of related data. Fast access of data with index. Memory efficient. Simple to implement.
Cons of an array
You can’t alter the arrays length during runtime. Can only store one kind of data.
What is a tuple?
An ordered sequence of elements. Completely immutable. Can be different data types. Used to group and organise data items.
Pros of a tuple.
Faster than lists and arrays. memory efficient. Prevents web modification making it unchangeable and so can’t be accidentally changed.
Cons of a tuple.
Can’t be modified, you would need to create a new tuple to update the list.
Definition of a stack.
Holds a sequence of items in an ordered list. LIFO. You can only access data on the top position of the list, (using pop(), push()).