Algorithms: Searching, Sorting, and Recursive Methods

0.0(0)
Studied by 0 people
0%Unit 4 Mastery
0%Exam Mastery
Build your Mastery score
multiple choiceMultiple Choice
call kaiCall Kai
Supplemental Materials
Card Sorting

1/27

Last updated 8:46 PM on 3/4/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

28 Terms

1
New cards

Linear Search

A simplest searching algorithm that checks every element in a list sequentially until the target is found.

2
New cards

Binary Search

A faster searching algorithm that divides the search interval in half, requiring a sorted array.

3
New cards

Pre-condition for Binary Search

The array or list MUST be sorted.

4
New cards

Best Case for Linear Search

The target is at the first index, requiring only 1 comparison.

5
New cards

Worst Case for Linear Search

The target is at the last index or not present, requiring N comparisons.

6
New cards

Efficiency of Linear Search

Slower for large lists, operating in O(N) time complexity.

7
New cards

Efficiency of Binary Search

Very fast, operating in O(log N) time complexity.

8
New cards

Selection Sort

An algorithm that finds the minimum element and moves it to its correct place.

9
New cards

Key behavior of Selection Sort

After pass k, the first k elements are sorted and are the k smallest elements.

10
New cards

Insertion Sort

An algorithm that builds a sorted list one element at a time by inserting new elements into their correct positions.

11
New cards

Key behavior of Insertion Sort

After pass k, the first k+1 elements are sorted relative to each other.

12
New cards

Base Case in Recursion

The condition under which the recursion stops and returns a value without calling itself.

13
New cards

Recursive Step

The logic that calls the method again with values closer to the base case.

14
New cards

Merge Sort

A recursive sorting algorithm that uses the Divide and Conquer strategy.

15
New cards

Temporary Array in Merge Sort

Merge Sort requires a helper array to merge elements, using more memory.

16
New cards

Time complexity of Merge Sort

Faster than Selection/Insertion, operating in O(N log N) time.

17
New cards

Call Stack in Recursion

The structure that keeps track of method calls during recursion, allowing the method to pause and resume.

18
New cards

Mistake with Binary Search on Unsorted Data

Trying to trace Binary Search on an unsorted list leads to undefined results.

19
New cards

Off-by-One Error in Binary Search

Mistakenly updating boundaries to low = mid or high = mid instead of moving past mid.

20
New cards

Selection vs. Insertion Sort

Selection Sort swaps elements; Insertion Sort shifts elements.

21
New cards

Infinite Recursion

Occurs when the base case condition is not satisfied, leading to a StackOverflowError.

22
New cards

Factorial Recursive Function

A common recursion example where n! = n × (n-1)!

23
New cards

Divide and Conquer in Merge Sort

The principle where the list is split into halves which are recursively sorted.

24
New cards

Worst Case for Binary Search

Requires log N comparisons when the list is sorted.

25
New cards

Sorting Requirement for Binary Search

The list or array must be sorted to utilize Binary Search effectively.

26
New cards

Conquer phase in Merge Sort

Recursively sort each half of the split list.

27
New cards

Merge step in Merge Sort

Combines two sorted halves into a single sorted list by comparing elements.

28
New cards

Selection Sort Algorithm

Iteratively finds the minimum element and swaps it with the current index.

Explore top notes

note
Chemical bonds
Updated 974d ago
0.0(0)
note
History of England
Updated 1275d ago
0.0(0)
note
Indirect Values
Updated 1499d ago
0.0(0)
note
Chemistry of Life, Biology
Updated 1769d ago
0.0(0)
note
Photons
Updated 899d ago
0.0(0)
note
Biology - Evolution
Updated 1476d ago
0.0(0)
note
Chemical bonds
Updated 974d ago
0.0(0)
note
History of England
Updated 1275d ago
0.0(0)
note
Indirect Values
Updated 1499d ago
0.0(0)
note
Chemistry of Life, Biology
Updated 1769d ago
0.0(0)
note
Photons
Updated 899d ago
0.0(0)
note
Biology - Evolution
Updated 1476d ago
0.0(0)

Explore top flashcards

flashcards
faf
40
Updated 956d ago
0.0(0)
flashcards
faf
40
Updated 956d ago
0.0(0)