Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 1009 Bytes

File metadata and controls

32 lines (21 loc) · 1009 Bytes

🔢 Maths Algorithms

Java Algorithms

A collection of fundamental searching and sorting algorithms implemented in Java, written as part of a learning exercise to explore how classic algorithms work under the hood.

Algorithms included

File Category Time complexity (avg)
BinarySearch.java Searching O(log n)
LinearSearch.java Searching O(n)
BubbleSortExample.java Sorting O(n²)
InsertionSort.java Sorting O(n²)
SelectionSort.java Sorting O(n²)
Quicksort.java Sorting O(n log n)

Running the code

Compile and run any file individually using the Java CLI:

javac BinarySearch.java && java BinarySearch

Requirements

Java 8 or higher.

Notes

Binary search requires the input array to be sorted before searching. All other algorithms operate on unsorted input.