mistakes + useful to know

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

1/15

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 1:51 PM on 6/12/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

16 Terms

1
New cards

describe linear search algorithm

  • compares the first value in the array to the value being searched for

  • stops if the comparison is true

  • moves to the next value in the array if the comparison if false

2
New cards

describe the purpose of a truth table

to show all of the possible inputs and the associated outputs for each input

3
New cards

describe the steps to perform a binary search on a sorted list (6)

  • select middle number

  • check if selected number matches the target

  • if searched number is larger, discard left half

  • if searched number is smaller, discard right half

  • repeat until number is found

  • or remaining list is size 0

4
New cards

describe how a linear search would search a number not in the list (2)

  • start with first value

  • check values in order

5
New cards

what to do with gap fills

  • read extremely carefully

6
New cards

format to write code which uses a pre-existing function, newPrice() for premium and 5 and outputs it.

print(newPrice("premium", 5))

7
New cards

why does the inner loop have to be a condition controlled loop (insertion sort algorithm)? (3)

  • don’t know how many iterations needed/times it needs to run

  • repeats while a condition is true

  • will swap until in correct position

8
New cards

differences between insertion sort and bubble sort: (5,3)

insertion

  • moves values into correct position

  • one pass needed

  • sorted and unsorted list

  • starts on 2nd value

  • more efficient because fewer comparisons when data is more scrambled

bubble

  • swaps pairs of values until in correct position

  • multiple passes needed

  • less efficient because more comparisons when data is more scrambled

9
New cards

similarities between insertion and bubble sort (6)

  • produce sorted list

  • both need temporary variable

  • both swap values

  • left to right

  • compare pairs of values

  • less efficient on larger lists

10
New cards

why should programs be tested? (5)

  • check it works as intended

  • correct output

  • check for errors + fix them

  • check it is robust

  • anticipating misuse

11
New cards

why does high level code have to be translated before it is executed? (2)

  • convert it to machine code

  • the processor can only understand machine code

12
New cards

what to do when you have to show the stages of a bubble sort on a list of data?

do one swap per line

13
New cards

if completing a pseudocode function which doesn’t have a defined name…

give the function a name, don’t just try and call it with function()

14
New cards

reasons for using a 2D array to store data (5)

  • multiple items of data can be stored

  • same data type

  • can be represented in a table

  • one variable name

  • efficient access of data

15
New cards

define record

data structure used to store multiple pieces of data about one thing together

16
New cards

define field

one of the items in a record that contains a particular piece of data