NEW
Font size
WorksheetsSHS 9.4 Python
Total questions: 19
Worksheet time: 6mins
A static data structure which can store multiple items of
data, of the same datatype, under a single name.
Arrays
Flags
Binary Search
Merge Sort
A section in an array or list that can store one piece of data.
Element
Python List
Array
2D Array
An array, which contains a single list of data items, each being identifiable using a single
number index.
1D Array
Algorithm
2D Array
Insertion Sort
An array, which contains multiple lists of data items, each being identifiable using an index made up of two numbers, one to identify the Array and the other to identify the element within that array.
2D Arrary
1D Array
Flags
Pointers
The first element in an array is obviously position 1, however, the computer considers it index 0.
Index 0 v Position 1
Pointers
Arrays
Linear Search
Similar to an array, however, more flexible.
They can store data of any type at the same time e.g. List = [1, "two", 3.0"]
Python list
3D Array
Element
Binary Search
We can add elements to lists using: Add the data item to the end of the existing list - List.append(data) or Insert the data into the list at a given index - List.insert(index, data)
Add an element to a list
A Pass
Algorithm
Arrays
We can delete elements from lists using: List.remove(data) - searches for the first instance of data specified and removes it. List.pop(index) - returns and data and deletes the element at the given
Remove an element from a list
Algorithm
Add an element to a list
Insertion sort
Python lists can easily be sorted or reversed using: list.sort() and list.reverse()
Sort/reverse a list
A pass
Flags
2D array
A set of steps/instructions needed to complete a complex software task.
Algorithm
Pointers
Python list
1D Array
One iteration of an algorithm that contains a loop.
A pass
Pointers
Divide and conquer
Python List
The list is repeatedly split into two halves, with the half without the search criteria being discarded, until all elements have been checked or the search item is found
1D Array
A Pass
Divide and conquer
Normally a Boolean variable, called a truth bit. It is used a reference to see if
something has changed during the last iteration of an algorithm.
Flags
Bubble sort
Arrays
Elements
Normally an integer variable used to point to parts of an array or list. Usually the
lowest point, mid point and end point. They are used to keep track of where you are at.
Pointers
Linear Search
Python list
Add an element to a list
A sequential method of searching for an item in a dataset. This is done by systematically
checking each item in order until every element has been checked or item is found
A method of searching for an item in a sorted dataset. It compares the middle element within the search criteria, discards the half that does not include the search criteria, repeatedly until the item is found. If the midpoint falls between two elements, the right is always chosen.
A method of sorting a set of data by repeatedly comparing data items with previous items in a dataset, before inserting them into the correct position.
A method of sorting a set of data by repeatedly comparing data items with previous items in a dataset, before inserting them into the correct position.
A method of sorting a set of data by splitting the dataset up into its individual items and
then continually pairing items from the dataset in order until the entire dataset has been ordered. If the midpoint falls between two elements, the left side gets the extra.
