The Number Sorter is a simple project that sorts an array of numbers in ascending order. This project was built as part of the FreeCodeCamp curriculum to practice algorithmic thinking and basic problem-solving using JavaScript. The project allows users to input an array of numbers, and the program will sort them efficiently.
- Sorting Algorithm: Implements a sorting algorithm (e.g., Bubble Sort or Merge Sort) to sort the numbers in ascending order.
- User Input: Users can input an array of numbers (positive, negative, and decimals).
- Edge Case Handling: The program gracefully handles edge cases such as empty arrays, negative numbers, and decimal values.
- JavaScript: For implementing the sorting algorithm and logic.
- HTML/CSS: For the front-end UI, allowing users to interact with the sorter.
- Clone this repository to your local machine:
git clone https://github.com/mdkeum/number-sorter.git - Navigate to the project directory:
cd number-sorter - Open index.html in your browser to view and interact with the Number Sorter.
You can try the live demo of this project by visiting the following link: Live Demo
You can also see the project on CodePen: CodePen Demo
-Understanding and implementing sorting algorithms.
-Improving problem-solving skills.
-Learning how to handle various edge cases in user input.
Bubble Sort: A simple sorting algorithm that compares adjacent elements and swaps them if they are in the wrong order. It's easy to understand but not the most efficient for large datasets.
Selection Sort: A sorting algorithm that repeatedly selects the smallest (or largest) element from the unsorted portion of the array and swaps it with the element at the current position. It's simple but also not very efficient.
Insertion Sort: A sorting algorithm that builds the sorted array one item at a time by inserting each element into its correct position within the sorted portion of the array. It works well for small datasets but struggles with larger ones.
This project is open-source and available under the MIT License.
Thanks to FreeCodeCamp for providing the resources to learn and build this project.