Fundamentals of algorithms

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/75

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

76 Terms

1
New cards

What is an algorithm?

A sequence of steps designed to complete a task

2
New cards

How is an algorithm different from a program?

An algorithm is the plan; a program is the coded implementation

3
New cards

What is decomposition?

Breaking a problem down into sub-problems, each with an identifiable task

4
New cards

What is abstraction?

Removing unnecessary details from a problem to focus on essentials

5
New cards

Why use decomposition in programming?

Makes complex problems easier to solve and maintain

6
New cards

What are the main ways to represent an algorithm?

Pseudocode, flowcharts, program code

7
New cards

What is pseudocode?

A simple way to write algorithms using code-like instructions, not language-specific

8
New cards

What is a flowchart?

A diagram showing the steps of an algorithm using symbols

9
New cards

What is program code?

Instructions written in a programming language (like Python, Java)

10
New cards

When might you be asked to use pseudocode or flowchart in an exam?

When indicated in AQA exam, according to standard formats

11
New cards

How do you identify inputs in an algorithm?

Inputs are values or data provided to start the algorithm

12
New cards

How do you identify outputs in an algorithm?

Outputs are results produced by the algorithm

13
New cards

What is 'processing' in an algorithm?

Steps/manipulation that transform inputs into outputs

14
New cards

What is a trace table?

Table used to track variable values step by step as an algorithm runs

15
New cards

How can you use a trace table?

Visualise how a simple algorithm works as each step/iteration is made

16
New cards

How do you determine the purpose of an algorithm?

Look at how inputs are transformed into outputs, and overall flow

17
New cards

Can different algorithms solve the same problem?

Yes, multiple algorithms can be designed for a single task

18
New cards

What does 'algorithm efficiency' mean?

How quickly (in time/steps) an algorithm solves a problem

19
New cards

What is meant by time efficiency in algorithms?

How long an algorithm takes to find the solution

20
New cards

Is formal comparison of efficiency required for GCSE?

No, only time efficiency in simple explanations

21
New cards

What is a linear search algorithm?

Checks each item in a list, one at a time, until the target is found or list ends

22
New cards

What is a binary search algorithm?

Repeatedly divides a sorted list in half, checking the middle each time

23
New cards

What is required for binary search to work?

List must be sorted

24
New cards

How does linear search work mechanically?

Starts from first item, compares each, moves forward until match or end

25
New cards

How does binary search work mechanically?

Finds middle item, compares target; if not match, chooses half to search next; repeat

26
New cards

Give an advantage of linear search.

Works on unsorted lists, simple to code

27
New cards

Give a disadvantage of linear search.

Slower for large lists; must check every item in worst case

28
New cards

Give an advantage of binary search.

Faster for large sorted lists (cuts search space in half each time)

29
New cards

Give a disadvantage of binary search.

Needs sorted data; more complex logic

30
New cards

How do you compare linear and binary search?

Both find items; binary usually faster but needs sorted data, linear requires no sorting

31
New cards

What is a bubble sort algorithm?

Repeatedly passes through list, swapping adjacent items if needed until sorted

32
New cards

How does bubble sort work?

Compares pairs, swaps as needed; multiple passes until no swaps needed

33
New cards

What are the advantages of bubble sort?

Simple to understand and code

34
New cards

What are the disadvantages of bubble sort?

Slow on large lists, inefficient (many passes/tests)

35
New cards

What is a merge sort algorithm?

Divides list into halves, sorts each half, merges sorted halves together

36
New cards

How does merge sort work mechanically?

Recursively splits list, sorts sublists, merges back into sorted order

37
New cards

What are the advantages of merge sort?

Fast for large lists, efficient, reliable

38
New cards

What are the disadvantages of merge sort?

Uses more memory for temporary lists/recursion

39
New cards

How do you compare bubble sort and merge sort?

Bubble is simple and good for small lists; merge is efficient for large lists but uses more memory

40
New cards

Why is understanding inputs, outputs, processing important in algorithms?

Clarifies what the algorithm needs, what it does, and what it produces for successful design

41
New cards

Define the term 'algorithm representation'.

How algorithms are shown (e.g. pseudocode, flowchart, program code)

42
New cards

Why use systematic approaches to algorithm creation?

Ensures steps are clear, logical, and efficient

43
New cards

What does it mean to use "visual inspection" for algorithms?

Step through and check each line/box to figure out the algorithm’s purpose

44
New cards

How might you be asked about algorithms using pseudocode in an exam?

Shown standard AQA pseudocode and required to interpret or write it in that format

45
New cards

What are standard symbols used in flowcharts?

Oval: Start/End, Parallelogram: Input/Output, Rectangle: Process, Diamond: Decision

46
New cards

How do you identify algorithms with trace tables?

Fill in table for each line/step, updating values as the algorithm runs

47
New cards

Why can multiple algorithms solve the same problem in programming?

Different methods may have different advantages (e.g., speed, simplicity)

48
New cards

What is meant by an 'efficient' algorithm in GCSE exams?

Quick to complete (time-wise), may use fewer steps

49
New cards

What does "exam will only refer to time efficiency" mean?

Questions will ask which algorithm is faster, not about memory or other resources

50
New cards

How do you explain the mechanics of linear search?

Step through each list item in order, check for match until found or finished

51
New cards

How do you explain the mechanics of binary search?

Divide sorted list, select middle, decide which half to search next; repeat

52
New cards

How do you explain the mechanics of merge sort?

Split list into halves, keep splitting until single items, then merge up in sorted order

53
New cards

How do you explain the mechanics of bubble sort?

Iterate list, swap adjacent out-of-order items, repeat passes until sorted

54
New cards

What is the key difference between linear and binary search?

Linear is stepwise; binary divides and skips over lots of items (only works on sorted lists)

55
New cards

What is the key difference between bubble and merge sort?

Bubble sorts by swapping adjacent pairs; merge divides and conquers then merges

56
New cards

Why is abstraction used when designing algorithms?

Focuses only on important information, ignoring irrelevant details

57
New cards

Why is decomposition critical for solving complex problems?

Makes tasks more manageable, allows teamwork, supports debugging

58
New cards

What is a systematic approach to problem solving in computing?

Following set steps to break down and solve problems logically

59
New cards

When might you use a flowchart instead of pseudocode?

When visual representation helps clarify the process/logic

60
New cards

What is a decision point in a flowchart?

Diamond shape for "yes/no", "true/false" branching

61
New cards

Why do algorithms need to be clear and well-represented?

Ensures they can be implemented correctly by a programmer

62
New cards

How do you determine algorithm purpose with visual inspection?

Look at overall flow, see what output is produced from the inputs

63
New cards

What is pseudo code in AQA GCSE exams?

A set of clear, English-like instructions using standard format for Python-style code

64
New cards

Why is it important to understand the mechanics of search/sort algorithms?

To select the right method for different problems and data sizes

65
New cards

Give a sample pseudocode for linear search.

FOR each item in list: IF item == target THEN OUTPUT index; END IF; NEXT

66
New cards

Give a sample pseudocode for binary search.

Set left/right pointers; WHILE left <= right: Set mid = (left + right)/2; IF list[mid] == target THEN OUTPUT mid; ELSE IF target < list[mid] THEN right = mid -1; ELSE left = mid +1; END WHILE

67
New cards

Give sample pseudocode for bubble sort.

FOR i = 0 TO n-1: FOR j = 0 TO n-i-2: IF list[j] > list[j+1] THEN swap; END FOR; END FOR

68
New cards

Give sample pseudocode for merge sort.

If list size > 1 THEN split into halves; recursively sort left and right; merge halves

69
New cards

How do you check efficiency in practice?

Time how long each algorithm takes to finish on same problem

70
New cards

Why might merge sort use more memory than bubble sort?

Requires temporary arrays for splitting and merging

71
New cards

When is bubble sort acceptable to use?

Small datasets, simple programs, teaching concepts

72
New cards

Why is merge sort preferred for large datasets?

Less passes, more efficient sorting

73
New cards

What is the output of a trace table?

Clarified flow of data—shows each step’s values for variables

74
New cards

Why are sort and search algorithms important?

Used universally in computing to handle data in lists/arrays

75
New cards

What is an advantage of writing algorithms in pseudo code?

Language-free, easy for multiple programmers to understand

76
New cards