Data Collections Algorithms in Java: Searching, Sorting, and Recursion

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/24

Last updated 3:08 PM on 3/12/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

25 Terms

1
New cards

Searching (in a collection)

The process of determining whether a target item exists in a data collection (like an array or ArrayList) and, if so, where it is located.

2
New cards

Linear Search (Sequential Search)

A search algorithm that checks elements one-by-one from the start until the target is found or the collection ends.

3
New cards

Binary Search

A search algorithm for sorted data that repeatedly checks the middle element and discards half of the remaining range each step.

4
New cards

Sorted-Data Precondition

A required condition that the data must be in sorted order (typically ascending) for binary search to work correctly.

5
New cards

low (binary search)

The lower index bound of the current search range in binary search.

6
New cards

high (binary search)

The upper index bound of the current search range in binary search.

7
New cards

mid (binary search)

The middle index of the current range, often computed as (low + high) / 2, used for comparison to the target.

8
New cards

.equals (Java)

A method used to test content/value equality for objects (e.g., Strings) rather than whether they are the same reference.

9
New cards

Reference equality (==)

In Java, for objects, == checks whether two references point to the exact same object, not whether their contents are equal.

10
New cards

Off-by-one Error

A boundary mistake in loop conditions or index updates (e.g., using i <= arr.length), often causing incorrect results or runtime errors.

11
New cards

Sentinel Value (-1)

A conventional return value indicating “not found” when a search method is supposed to return an index.

12
New cards

Sorting

Rearranging elements into a specific order (often ascending or alphabetical), which can enable faster searching and easier data analysis.

13
New cards

Swap (using a temp variable)

A common pattern to exchange two array elements safely by storing one value in a temporary variable first.

14
New cards

Selection Sort

A sorting algorithm that repeatedly finds the smallest remaining element and swaps it into the next position at the front of the array.

15
New cards

minIndex (selection sort)

The index of the smallest value found so far in the unsorted portion during a selection sort pass.

16
New cards

Insertion Sort

A sorting algorithm that builds a sorted prefix by taking the next element (key) and inserting it into the correct position among earlier elements.

17
New cards

key (in insertion sort)

The value being inserted into the already-sorted prefix during an insertion sort iteration.

18
New cards

Shifting (in insertion sort)

Moving larger elements one position to the right to create a “hole” where the key can be inserted.

19
New cards

Comparable

A Java interface for classes that define a natural ordering via a compareTo method (e.g., String implements Comparable).

20
New cards

compareTo

A method that returns a negative number, 0, or a positive number depending on whether an object is less than, equal to, or greater than another in ordering.

21
New cards

Recursion

A technique where a method solves a problem by calling itself on a smaller/simpler input.

22
New cards

Base Case

The stopping condition in a recursive method that does not make another recursive call.

23
New cards

Recursive Case

The part of a recursive method where it calls itself with a smaller input, moving toward the base case.

24
New cards

Divide-and-Conquer

An approach that splits a problem into smaller subproblems, solves them (often recursively), and combines the results.

25
New cards

Merge Sort

A divide-and-conquer sorting algorithm that splits an array into halves, recursively sorts each half, and then merges the sorted halves into a fully sorted array.

Explore top notes

note
Invisible Man Chapter 1
Updated 1173d ago
0.0(0)
note
Media & Information Literacy
Updated 322d ago
0.0(0)
note
Invisible Man Chapter 7
Updated 1173d ago
0.0(0)
note
Unit 3 : Macromolecules
Updated 313d ago
0.0(0)
note
International Cooperation
Updated 1195d ago
0.0(0)
note
Biochimie
Updated 746d ago
0.0(0)
note
Invisible Man Chapter 1
Updated 1173d ago
0.0(0)
note
Media & Information Literacy
Updated 322d ago
0.0(0)
note
Invisible Man Chapter 7
Updated 1173d ago
0.0(0)
note
Unit 3 : Macromolecules
Updated 313d ago
0.0(0)
note
International Cooperation
Updated 1195d ago
0.0(0)
note
Biochimie
Updated 746d ago
0.0(0)

Explore top flashcards

flashcards
S.S. Unit 3 - Study Guide
57
Updated 126d ago
0.0(0)
flashcards
Chapter 27
120
Updated 705d ago
0.0(0)
flashcards
Lit Words: 2 The Boogaloo
24
Updated 496d ago
0.0(0)
flashcards
Lab Practical 3
75
Updated 755d ago
0.0(0)
flashcards
Polyatomic Ions
21
Updated 768d ago
0.0(0)
flashcards
Latin Week 5
26
Updated 920d ago
0.0(0)
flashcards
Connect 4, Unit 3
52
Updated 1011d ago
0.0(0)
flashcards
S.S. Unit 3 - Study Guide
57
Updated 126d ago
0.0(0)
flashcards
Chapter 27
120
Updated 705d ago
0.0(0)
flashcards
Lit Words: 2 The Boogaloo
24
Updated 496d ago
0.0(0)
flashcards
Lab Practical 3
75
Updated 755d ago
0.0(0)
flashcards
Polyatomic Ions
21
Updated 768d ago
0.0(0)
flashcards
Latin Week 5
26
Updated 920d ago
0.0(0)
flashcards
Connect 4, Unit 3
52
Updated 1011d ago
0.0(0)