Algorithms

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/39

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

40 Terms

1
New cards

What is abstraction in computational thinking?/Ignoring unnecessary information and focusing only on the important facts

2
New cards

Why is abstraction used in problem solving?/Because it simplifies a problem to make it less complex

3
New cards

What is decomposition in computational thinking?/Breaking a problem into smaller tasks to make it easier to solve

4
New cards

How does decomposition help in team-based problem solving?/It allows different people to work on different parts of a larger problem

5
New cards

What is algorithmic thinking?/Following logical steps to solve a problem

6
New cards

How are decomposition and abstraction related to algorithmic thinking?/They help prepare the problem for solving using logical steps

7
New cards

What is an algorithm?/A set of instructions presented in a logical sequence

8
New cards

Why do programmers create algorithm designs before coding?/To plan the program and consider potential problems before writing code

9
New cards

What do structure diagrams show?/The organisation of a problem in a visual format

10
New cards

What do trace tables do?/Track the value of variables as a program runs

11
New cards

How is each row and column used in a trace table?/Each row is an iteration and each column stores a variable’s changing value

12
New cards

What is a linear search?/A search that checks each data item in order from first to last

13
New cards

Does a linear search require the list to be sorted?/No

14
New cards

Why is a linear search inefficient for large lists?/Because it checks each item one at a time from start to end

15
New cards

What loop is used in a linear search?/A loop that checks each value and increments by 1

16
New cards

What happens if a linear search reaches the end without finding a match?/The value is not included in the list

17
New cards

What is a binary search?/A search that compares the midpoint of a sorted list to the target value

18
New cards

Why is binary search more efficient than linear search?/It checks fewer data items and is faster for large sets

19
New cards

What is a prerequisite for using a binary search?/The list must already be sorted

20
New cards

What values are calculated in a binary search?/Midpoint, lowpoint and highpoint

21
New cards

What loop is used in a binary search?/A while loop that compares the midpoint to the target value

22
New cards

What happens if the midpoint does not match the target in a binary search?/The upper or lower half of the data is ignored

23
New cards

What is merge sort based on?/Divide and conquer

24
New cards

How does a merge sort work?/It divides the list repeatedly until each item is separate, then merges them in order

25
New cards

When does the merge sort algorithm end?/When all sublists are merged into one sorted list

26
New cards

What is a key feature of a merge sort algorithm?/It is recursive and calls itself to split the list into left and right sides

27
New cards

When does the merge sort stop splitting lists?/When each sublist has a length of 1

28
New cards

What does a bubble sort do?/It compares adjacent data elements and swaps them if they are in the wrong order

29
New cards

When does a bubble sort stop?/When a full pass is made without any swaps

30
New cards

Is a bubble sort suitable for large data sets?/No

31
New cards

What loop controls the outer part of a bubble sort?/A while loop that checks if swaps were made

32
New cards

What loop controls the inner part of a bubble sort?/A for loop that iterates through the data set

33
New cards

What does the flag do in a bubble sort?/It tracks whether a swap has occurred

34
New cards

What is the purpose of a temporary variable in bubble sort?/To help correctly swap elements

35
New cards

How does an insertion sort begin?/By logically splitting the list into sorted and unsorted parts

36
New cards

How does an insertion sort place values?/By inserting unsorted values into the correct position in the sorted part

37
New cards

Is insertion sort more efficient for small or large data sets?/Small

38
New cards

What loop controls the outer part of an insertion sort?/A for loop that moves through each item

39
New cards

What loop controls the inner part of an insertion sort?/A while loop that moves backward to find the correct position

40
New cards

How does an insertion sort find the correct position?/By decreasing the index in the while loop to move backwards through the sorted part