Skip to content

rhmau1/sorting-array-in-c-sharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sorting-array-in-c-sharp

Sorting an array means to arrange the elements in the array in a certain order.
In C# we can sort arrays in several ways:

  1. Bubble sort
  2. Insertion sort
  3. Selection sort
  4. Quick sort
  5. Merge sort

Bubble Sort

Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order. The pass through the list is repeated until the list is sorted.

Insertion Sort

In insertion sort, every iteration moves an element from unsorted portion to sorted portion until all the elements are sorted in the list.

Selection Sort

Selection sort is generally used for sorting files with very large records and small keys. It selects the smallest (or largest) element in the array and then removes it to place in a new list. Doing this multiple times would yield the sorted array.

Quick Sort

Quick Sort is an efficient divide-and-conquer algorithm. It divides a large list into two smaller sub-lists based on a pivot chosen, into smaller and larger elements. Quick Sort then recursively does this to the sub-lists finally producing a sorted list.

Merge Sort

Merge sort is a very efficient comparison-based sorting algorithm. It is a divide-and-conquer algorithm, which works by repeatedly dividing the array in small parts and merging them again in the sorted order.

Source: https://www.thedshandbook.com/sorting-in-arrays/

About

Repository ini berisi tentang studi kasus sorting array dengan bahasa pemrograman C#

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages