Back to marketplace

Algorithms

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

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

Card preview (24)

#1
Front (Question)

binary search precondition

Back (Answer)

the list needs to be sorted

#2
Front (Question)

Insertion sort

Back (Answer)

works by dividing a list into two groups: sorted and unsorted. Elements are inserted one by one into their correct position in the sorted section.

#3
Front (Question)

linear search

Back (Answer)

starts at the beginning of a list and checks each item in turn until the desired item is found

#4
Front (Question)

Binary search

Back (Answer)

divides a list in two each time until the item being searched for is found

#5
Front (Question)

Four sorting algorithms

Back (Answer)

Bubble, Insertion, Quick, Merge

#6
Front (Question)

Insertion sort words

Back (Answer)

Make the first item in the list the sorted list. The remaining items are the unsorted list. While there are items in the unsorted list take the first item of the unsorted list. While there is an item to the left of it which is smaller than itself swap with that item. End while. The sorted list is now one item bigger. End while

#7
Front (Question)

Merge sort

Back (Answer)

splits a list of size n into n lists of size 1. Each pair of lists are merged together in order until there is only one list of size n.

#8
Front (Question)

Why does merge split down into unit lists

Back (Answer)

because a list of length one is sorted

#9
Front (Question)

Merge algorithm

Back (Answer)

• If the sub-list is 1 in length, then that sub-list has been fully sorted • If the list is more than 1 in length, then divide the unsorted list into roughly two parts. (An odd numbered length list can’t be divided equally in two) • Keep dividing the sub-lists until each one is only 1 item in length. • Now merge the sub-lists back into a list twice their size, at the same time sorting each items into order • Keep merging the sub-lists until the full list is complete once again.

#10
Front (Question)

Quick sort algorithm

Back (Answer)

REPEAT: 1. Pick a pivot 2. sort the items either side of the pivot 3. make the items either side of the pivot a sublist Until length of sublist= 1

#11
Front (Question)

Quick sort

Back (Answer)

The basic idea is to keep splitting a list into two smaller lists, sort those lists using the same quick-sort rules, then split the sub-lists and sort again, until there are only lists of 1 item or less left.

#12
Front (Question)

Where can the pivot be applied

Back (Answer)

The pivot can be applied to any item in the unsorted list.

#13
Front (Question)

advantages bubble

Back (Answer)

• simple

#14
Front (Question)

disadvantages bubble

Back (Answer)

• long time to run

#15
Front (Question)

advantages insertion

Back (Answer)

• Simple to code • Good performance with small lists • memory efficient • good with sequential data

#16
Front (Question)

disadvantages insertion

Back (Answer)

• poor performance with larger lists - not as quick as merge/quick sort

#17
Front (Question)

disadvantages quick

Back (Answer)

• difficult to implement • if a bad pivot is picked the runtime is slow • worst case efficiency is bad

#18
Front (Question)

advantages quick

Back (Answer)

• very efficient - no additional storage required/ less stack memory

#19
Front (Question)

advantages merge

Back (Answer)

• Good for sorting slow access data • Good for sorting sequential data • if there are two equal values then positions are conserved, which is quicker

#20
Front (Question)

disadvantages merge

Back (Answer)

• It needs twice then length of memory space than the list • If recursion is used, it used twice the stack memory as a quick-sort • quick sort is faster

#21
Front (Question)

advantages Linear search

Back (Answer)

• Good Performance • List does not need to be ordered • Not affected by insertions and deletions

#22
Front (Question)

disadvantages linear search

Back (Answer)

• May be too slow over large lists

#23
Front (Question)

advantages binary search

Back (Answer)

• Works well with larger lists - Quicker

#24
Front (Question)

disadvantages binary search

Back (Answer)

• Small lists simpler to use linear search - Cannot deal with unordered lists