

Ch Algo R2
Presentation
•
Computers
•
11th Grade
•
Practice Problem
•
Easy
Gyorgy Denes
Used 1+ times
FREE Resource
17 Slides • 5 Questions
1
Paper 2 - CT, algorithms programmming
Last time: programming constructs
Now: CT and arrays revision
2
3
Open Ended
What is an array?
4
Array:
A data structure that holds similar, related data
data = [100, 110, 85, 80, 92, 72, 66, 98, 100, 120]
5
6
Open Ended
write the code for an array that contains three colours that you like.
7
Indexing
Items are counted from the left starting at 0
subjects = ["English", "French", "Maths", "Computer Science", "Science"]
8
Fill in the Blank
subjects = ["English", "French", "Maths", "Computer Science", "Science"], write an expression to print French.
9
2D array
1D array: line of daya
2D array: table
10
Indexing
Now you have 2 indexes (indices):
Row, Column ..... or ..... Column, Row
11
Indexing - Col, Row
OCR reference language: table[3, 0]
Python: table[3][0]
12
Indexing - Row, Col
OCR reference language: table[0, 3]
Python: table[0][3]
13
Fill in the Blank
The 2D array in the image is stored in the variable numbers. Assuming that it is row,col indexed, write the Python expression that will print out 67
14
Fill in the Blank
The 2D array in the image is stored in the variable numbers. Assuming that it is row,col indexed, write the OCR reference expression that will print out 67
15
Algorithms on data structures
Keywords:
algorithm
abstraction
decomposition
16
Algorithms on data structures
Linear Search
Binary Search
Bubble Sort
Merge Sort
Insertion Sort
17
Linear Search
found = False
for each item in the list:
if item == target:
found = True
18
Binary Search
Check middle item
if equal, then STOP
if target < middle, repeat on left sub-list
if target > middle, repeat on right sub-list
19
Bubble sort
for each pass:
for each item from left to right,
compare item with neighbour and swap if out of order
20
Merge sort
Split into halves (repeatedly) until left with single items
merge pairs of sublists repeatedly (1s, 2s, 4s, 8s, etc.)
21
Insertion sort
for each item from index 1 to the end:
shift the item left until it reaches a number that is less than it
Paper 2 - CT, algorithms programmming
Last time: programming constructs
Now: CT and arrays revision
Show answer
Auto Play
Slide 1 / 22
SLIDE
Similar Resources on Wayground
15 questions
Computers and Devices
Lesson
•
KG - University
15 questions
Central and Inscribed Angles
Lesson
•
10th Grade
17 questions
Empowerment Technologies 2nd Quarter Review
Lesson
•
12th Grade
21 questions
Pengenalan Kode Program Python (Bag II)
Lesson
•
11th Grade
17 questions
T2.C6.1 | Context Types | Introduction
Lesson
•
11th Grade
16 questions
While
Lesson
•
KG
16 questions
MATERI STRUKTUR DATA
Lesson
•
11th Grade
15 questions
MEDIA PEMBELAJARAN ANALISIS DATA
Lesson
•
11th Grade
Popular Resources on Wayground
10 questions
5.P.1.3 Distance/Time Graphs
Quiz
•
5th Grade
10 questions
Fire Drill
Quiz
•
2nd - 5th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
15 questions
Hargrett House Quiz: Community & Service
Quiz
•
5th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade