T1: Algorithms

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/26

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 7:44 PM on 9/2/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

27 Terms

1
New cards

What is an algorithm?

A set of instructions to complete a task

2
New cards

What is decomposition?

Breaking down a large problem into smaller sub-problems (sub-problems can be broken down further into manageable tasks)

3
New cards

What are subtasks?

They are modules that may be reused in other programs

4
New cards

What is abstraction?

The process of removing unnecessary detail and focusing only on the essential features of a problem.

5
New cards

What is a variable?

A location in memory where you can temporarily store texts or numbers.

6
New cards

Flowchart - elongated oval

start/end

7
New cards

Flowchart - rectangle

Calculation/assignment

8
New cards

Flowchart - parallelogram

Input/output

9
New cards

Flowchart - diamond

Decision (with arrows pointing to options - mostly yes/no)

10
New cards

What is sequence (program structure)?

The program follows the order it's been coded in/statements executed in the order they're written in

11
New cards

What is selection (program structure)?

If statements - making decisions, next statement to be executed depends on whether the condition being tested is true or false

12
New cards

What is iteration (program structure)?

Repetition (loops)

13
New cards

What is MOD + symbol

Modulo - the remainder of what you're dividing %

14
New cards

What is DIV + symbol

Integer division //

15
New cards

Describe a for loop in pseudocode

FOR counter <-- 1 TO 7 (newLine) maxT <-- USERINPUT (newLine) ENDFOR

16
New cards

Describe a while loop in pseudocode

WHILE emailA does not contain "@"

OUTPUT "Invalid address"

emailA

17
New cards

Describe a repeat until pseudocode

REPEAT

emailA

18
New cards

Describe an if statement pseudocode

IF emailA does not contain "@" THEN

OUTPUT "Invalid address"

ENDIF

19
New cards

How to calculate max number of items to be checked in binary search

In a list of 2^n items - max no. of items need to be checked = n + 1

20
New cards

Steps for binary search

Look at the middle value (if number of values even, then look at the left one - the lower one)

If value is lower than the one you want to find, discard the first half of the list

If value is higher than the one you want to find, discard the top half of the list

Continue until you find what you're looking for

21
New cards

Compare binary search and linear search

List has to be sorted for binary search, b search more efficient

22
New cards

how pick a random number python

import random

random.randint(1,100)

23
New cards

How does bubble sort work/steps

Compare the first two items.

If they are in the wrong order, swap them.

Move to the next pair and repeat (compare and swap if needed).

Keep going until you reach the end of the list - at this point, the largest value "bubbles up" to the end - this is called a pass

Go back to the start of the list and repeat the process

Continue until a full pass is made with no swaps needed → the list is sorted.

24
New cards

Describe merge sort (not the steps)

Happens with 2 or more different lists. Combines 2 lists and puts them in order.

25
New cards

Steps for merge sort

Divide the unsorted list into n sublists, each containing one element

Repeatedly merge two sublists at a time to produce new sorted sublists until there is only one sublist remaining. = sorted lists

26
New cards

How to merge lists

Compare 1st values

Put the lower value in the list

Compare lowest values of the lists needing to be sorted

Put lower value in the list

27
New cards

What is a module

a section (sub task)