This Dart library provides a collection of sorting algorithms for various data types. These algorithms facilitate sorting collections, from simple lists to more complex data structures.
The Sorter
class offers various sorting algorithms, including:
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Heap Sort
- Radix Sort
- Bucket Sort
- Sorting for Specific Data Types
-
Import the necessary classes:
import 'package:sorter/sorter.dart';
-
Call the desired sorting function with your data:
List<int> unsortedList = [5, 2, 9, 1, 5]; List<int> sortedList = Sorter.bubbleSort(unsortedList);
Replace
bubbleSort
with the sorting algorithm of your choice.
The library supports sorting for:
- Integers
- Doubles
- Strings
- Dates
- Colors
- Geographic Coordinates
- Firebase Documents
- Files
- And more...
Most sorting functions support additional parameters for customization, such as reversing the sorting order or specifying comparison functions.
Feel free to contribute by submitting bug fixes, enhancements, or additional sorting algorithms. Fork this repository, make changes, and create a pull request.