algokit library
A versatile Dart algorithms library providing implementations of various algorithms.
Classes
- ComplexNumber
- A class representing complex numbers and their operations.
-
LinkedList<
T> - A generic LinkedList implementation that provides basic list operations.
-
Queue<
T> - A generic Queue implementation that follows First-In-First-Out (FIFO) principle.
-
Stack<
T> - A generic Stack implementation that follows Last-In-First-Out (LIFO) principle.
Functions
-
binarySearch<
T extends Comparable< (T> >List< T> list, T target) → int - Implements the Binary Search algorithm Time Complexity: O(log n) Space Complexity: O(1) Note: List must be sorted in ascending order
-
bubbleSort<
T extends Comparable< (T> >List< T> list) → List<T> - Implements the Bubble Sort algorithm Time Complexity: O(n²) Space Complexity: O(1)
-
heapSort<
T extends Comparable< (T> >List< T> list) → List<T> - Implementation of Heap Sort algorithm Time Complexity: O(n log n) Space Complexity: O(1)
-
insertionSort<
T extends Comparable< (T> >List< T> list) → List<T> - Implementation of Insertion Sort algorithm Time Complexity: O(n²) Space Complexity: O(1)
-
interpolationSearch<
T extends num> (List< T> list, T target) → int - Implementation of Interpolation Search algorithm Time Complexity: O(log log n) for uniformly distributed data Space Complexity: O(1)
-
jumpSearch<
T extends Comparable< (T> >List< T> list, T target) → int - Implements Jump Search algorithm Time Complexity: O(√n) Space Complexity: O(1) Note: List must be sorted in ascending order
-
linearSearch<
T> (List< T> list, T target) → int - Implements the Linear Search algorithm Time Complexity: O(n) Space Complexity: O(1)
-
mergeSort<
T extends Comparable< (T> >List< T> list) → List<T> - Implements the Merge Sort algorithm Time Complexity: O(n log n) Space Complexity: O(n)
-
quickSort<
T extends Comparable< (T> >List< T> list) → List<T> - Implements the Quick Sort algorithm Time Complexity: O(n log n) average case Space Complexity: O(log n)
-
selectionSort<
T extends Comparable< (T> >List< T> list) → List<T> - Implementation of Selection Sort algorithm Time Complexity: O(n²) Space Complexity: O(1)
-
shellSort<
T extends Comparable< (T> >List< T> list) → List<T> - Implementation of Shell Sort algorithm Time Complexity: O(n log n) in best case, O(n^2) in worst case Space Complexity: O(1)