cs paper 1

studied byStudied by 2 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 20

flashcard set

Earn XP

Description and Tags

21 Terms

1
algorithm
a sequence of steps that can be followed to complete a task
New cards
2
computer program
an implementation of an algorithm
New cards
3
decomposition
breaking down a problem into a number of sub-problems
New cards
4
abstraction
the process of removing unnecessary detail from a problem
New cards
5
linear search algorithm
compares the search item against each item in the list one by one
New cards
6
advantages of linear search
simple, no sorting required, good for short lists
New cards
7
disadvantages of linear search
slow, inefficient for long lists
New cards
8
search algorithm
finding a value in a data structure
New cards
9
binary search algorithm
finds the position of the target value within a sorted array by checking the middle value and then discarding half the list each time
New cards
10
advantage of binary search
quick
New cards
11
disadvantages of binary search
list needs to be sorted before searching
New cards
12
Boolean logic
a data type with two values, true or false
New cards
13
sorting algorithm
to order an unordered list
New cards
14
bubble sort
compares each pair in a list and swaps them if they are in the wrong order, repeats until there are no more swaps to be made
New cards
15
advantage of bubble sort
very simple so easy to program
New cards
16
disadvantage of bubble sort
slow for long lists
New cards
17
maximum number of comparisons for bubble sort
n(n-1)/2 comparisons
New cards
18
merge sort
splits a list into sub lists and then merges them back together in order
New cards
19
recursive function
calls itself in its definition
New cards
20
advantage of merge sort
much faster than bubble sort
New cards
21
disadvantage of merge sort
more complex to understand and code because it is recursive
New cards
robot