Skip to content

chaitu1410/sorting-programs-in-bash-script

Repository files navigation

Sorting Programs using Bash Script

Sorting Techniques

  • Bubble Sort
  • Selection Sort
  • Insertion Sort
  • Merge Sort
  • Quick Sort
  • Radix Sort
  • Shell Sort
  • Heap Sort

Above all scripts read numbers from file 'numbers.txt'.

The script 'generatenumbers.sh' is used to generate random numbers Send number of random numbers you want to generate as argument. If argument is not sent then 1000 numbers will generated by default.

./generatenumbers.sh total_numbers_you_want_to_generate

eg. ./generatenumbers.sh 500

Before running above scripts in linux bash terminal you need to change file permissions to allow current user to run specified script. You can do this using following command

chmod 700 your_script_name.sh

To run other scripts then just run following command; firstly navigate to the directory where script is located using 'cd' command

./your_script_name.sh

If you want to calculate time taken by script to sort the array then run following command; firstly navigate to the directory where script is located using 'cd' command

time ./your_script_name.sh

Authors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages