Skip to content

nathsotomayor/sorting_algorithms

Repository files navigation

Sorting Algorithms & Big O Notation

Untitled

In computer science, a sorting algorithm is an algorithm that puts elements of a list in a certain order. The most frequently used orders are numerical order and lexicographical order. Efficient sorting is important for optimizing the efficiency of other algorithms (such as search and merge algorithms) that require input data to be in sorted lists. Sorting is also often useful for canonicalizing data and for producing human-readable output. More formally, the output of any sorting algorithm must satisfy two conditions:

  • The output is in nondecreasing order (each element is no smaller than the previous element according to the desired total order).
  • The output is a permutation (a reordering, yet retaining all of the original elements) of the input.

Big O notation is used in Computer Science to describe the performance or complexity of an algorithm. Big O specifically describes the worst-case scenario, and can be used to describe the execution time required or the space used (e.g. in memory or on disk) by an algorithm.

General Project Requirements:

  • All your files will be compiled on Ubuntu 14.04 LTS
  • Your programs and functions will be compiled with gcc 4.8.4 using the flags -Wall -Werror -Wextra and -pedantic
  • Your code should use the Betty style. It will be checked using betty-style.pl and betty-doc.pl
  • You are not allowed to use global variables
  • No more than 5 functions per file
  • All your header files should be include guarded
  • A list/array does not need to be sorted if its size is less than 2

Usage

Download:

Clone the repository with the command line interface:

git clone https://github.com/nathsotomayor/sorting_algorithms.git

Compilation:

Compile .c files with:

gcc -Wall -Werror -Wextra -pedantic file.c -o file

Execution:

user@ubuntu:~/sorting_algorithms$ ./file

Extra information

Big O Notation Files

In this files are the big O notations of the time complexity of the each sorting algorithm with their best case, average case, worst case.

File Sorting Algorithm
0-O Big O notations of the time complexity of the Bubble Sort Algorithm
1-O Big O notations of the time complexity of the Insertion Sort Algorithm
2-O Big O notations of the time complexity of the Selection Sort Algorithm
3-O Big O notations of the time complexity of the Quick Sort Algorithm

Resources

Big-O Cheat Sheet

Authors

Javier Charria - GitHub | Twitter

Nathaly Sotomayor Ampudia - GitHub | Twitter

Made with 💛 in Holberton School

About

Sorting algorithms & Big O in C programming language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages