Efficiency of algorithms - 3.1.2

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

1/4

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.

5 Terms

1
New cards

What is a linear search?

A linear search checks each item in a list one at a time until it finds the target or reaches the end of the list.

2
New cards

What is a binary search?

A binary search repeatedly divides a sorted list in half, deciding whether to continue the search in the left or right half, until the item is found or the list cannot be divided further.

3
New cards

Give 1 advantage and disadvantage of a binary search

A binary search is faster but the list needs to be sorted

4
New cards

What is a bubble sort?

A bubble sort compares adjacent items in a list and swaps them if they are in the wrong order. This is repeated until the list is sorted.

5
New cards

What is a merge sort?

A merge sort uses a divide-and-conquer approach. It splits the list into halves, recursively sorts each half, and then merges the sorted halves back together.