Back to marketplace

2.1.3 - Searching and Sorting Algorithms

No description yet. This curated deck is ready for daily study.

Total cards: 15•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (15)

#1
Front (Question)

Types of searching algorithms

Back (Answer)

Linear search and Binary Search

#2
Front (Question)

Does the list in a linear search have to be ordered or unordered

Back (Answer)

It can be either

#3
Front (Question)

Does the list in a binary search have to be ordered or unordered

Back (Answer)

It has to be ordered

#4
Front (Question)

How does a linear search work? (3 steps)

Back (Answer)

• The length of the list is found • The program searches through the values in order from the start using a counter • It stops once the required value has been found or the list ends LESS EFFECTIVE THAN BINARY

#5
Front (Question)

Hows does a binary search work? (4 steps)

Back (Answer)

• Finds the midpoint of the ordered list • If the midpoint isn’t the required value then it checks if the required value is lower or higher than the midpoint • If value is higher, it disregards all smaller numbers and if the value is lower, it disregards all larger numbers • This repeats until the value is found MORE EFFECTIVE THAN LINEAR

#6
Front (Question)

Types of sorting algorithms

Back (Answer)

• Bubble sort - temp + swaps • merge sort - sublists • insertion sort - inserts into correct place

#7
Front (Question)

Advantages and disadvantages of bubble sort

Back (Answer)

• Easy to understand • However, very slow and inefficient

#8
Front (Question)

Advantages and disadvantages of merge sort

Back (Answer)

• Very quick comparisons - better for use on large data sets than other sorting methods • Difficult to understand and needs lots of memory *

#9
Front (Question)

Advantages and disadvantages of insertion sort

Back (Answer)

• Quicker than a bubble sort • Good for inserting extra data into already sorted lists • Not efficient when used on large data sets

#10
Front (Question)

Similarities of a bubble sort and an insertion sort

Back (Answer)

• Both less efficient that a merge sort • Both produce a sorted list • Both work from left to right’ • Both swap values • Both have nested loops

#11
Front (Question)

Difference between a bubble an insertion sort

Back (Answer)

• An insertion sort moves the value into its correct postition • A bubble sort repeatdely swaps values until it is in the correct position

#12
Front (Question)

Steps in a merge sort DIVIDE AND CONQUER

Back (Answer)

• The list is split into sublist and this repeats until each element has its own sublist (sublist with a length of 1) • Each pair of adjacent sublists is compared and combined to form an ordered sublist with length 2 • This process is repeated until there is only one list left and the list will be ordered

#13
Front (Question)

Steps in a bubble sort

Back (Answer)

• Start at the fron of the list and compare the two elements • If they are in the righ order, don’t swap but if they aren’t swap • Repeat for next 2 elements and repeat until one full pass has been made • Repeatedly perform passes until a pass has been done and no swaps have been made

#14
Front (Question)

Tips to identify the different sorting algos

Back (Answer)

• Bubble - look for temp + nested loop • Insertion - nested loop + i and i-1 • Merge - lots of sublists

#15
Front (Question)

Why is the nested loop used in bubble and insertion sorts condition controlled

Back (Answer)

• Don’t know how many swaps are needed • Will keep swapping until in correct position