a Lua module that provides implementations of various sorting algorithms.

alimiracle 75d3b3d858 move to 1.0.2 10 months ago
.gitignore ba1b0a8f57 lua-sort 10 months ago
LICENSE ba1b0a8f57 lua-sort 10 months ago
README.md ba1b0a8f57 lua-sort 10 months ago
lua-sort-1.0-1.rockspec 63ac41d57e make it use lua >5.1 10 months ago
lua-sort-1.0-2.rockspec 75d3b3d858 move to 1.0.2 10 months ago
lua-sort.lua b85045c62e moved quickSort function below partition to prevent calling nil value error 10 months ago

README.md

lua-sort:

a Lua module that provides implementations of various sorting algorithms.

Usage:

To use the lua-sort module, you can require it in your Lua program:

local sort = require("lua-sort")

Once required, you can use any of the provided sorting algorithms by calling the corresponding function on the sort module.

For example, to sort an array using the bubble sort algorithm:

local arr = {5, 2, 9, 1, 7}
sort.bubbleSort(arr)

After calling the sorting function, the arr table will be sorted in ascending order.

You can replace bubbleSort with the name of any other sorting algorithm to use a different sorting method.

Available Sorting Algorithms:

  • Bubble Sort algorithm
  • Insertion Sort algorithm
  • Selection Sort algorithm
  • Merge Sort algorithm
  • Quick Sort algorithm
  • Shell Sort algorithm
  • Counting Sort algorithm
  • Heap Sort algorithm
  • Radix Sort algorithm
  • Introsort algorithm
  • Block Sort algorithm
  • Timsort algorithm
  • Cubesort algorithm
  • Exchange Sort algorithm
  • Tree Sort algorithm
  • Cycle Sort algorithm
  • Strand Sort algorithm
  • Tournament Sort algorithm
  • Gnome Sort algorithm
  • Comb Sort algorithm
  • Cocktail Shaker Sort algorithm
  • Pigeonhole Sort algorithm
  • Bucket Sort algorithm (uniform keys)
  • Bucket Sort algorithm (integer keys)
  • Spreadsort algorithm
  • Burstsort algorithm
  • Flashsort algorithm

License:

This project is licensed under the GPL v3 License - see the LICENSE file for details.