Skip to content

This repository visualizes Selection Sort, an algorithm that sorts numbers. It iterates through an array, finding the smallest unsorted element and swapping it with the first unsorted position. This repeats until the array is sorted.

Notifications You must be signed in to change notification settings

Algorithmic-Solutions/SelectionSort-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Selection Sort Algorithm Visualization

This interactive repository showcases the Selection Sort algorithm using JavaScript and HTML. Witness how an array is sorted visually in ascending order, with each step clearly represented.

What is Selection Sort?

Selection Sort is a fundamental comparison-based sorting technique. It repeatedly searches through the unsorted portion of an array, finding the minimum element and swapping it with the element at the beginning of that unsorted section. This process continues until the entire array is sorted.

Key Points:

  • Time Complexity: O(n^2) in all cases - The number of comparisons and swaps grows quadratically with the input size (n). This means larger arrays take more time to sort using Selection Sort.
  • Space Complexity: O(1) - Selection Sort is an in-place sorting algorithm, meaning it modifies the original array without requiring significant additional data structures.

Get Sorting!

  1. Clone this repository.
  2. Open index.html in your web browser.
  3. Observe the visual representation as the array is sorted step-by-step.

About

This repository visualizes Selection Sort, an algorithm that sorts numbers. It iterates through an array, finding the smallest unsorted element and swapping it with the first unsorted position. This repeats until the array is sorted.

Topics

Resources

Stars

Watchers

Forks