For Custom Inputs

Algorithm Information


Bubble Sort

Bubble sort is a basic algorithm for arranging a string of numbers or other elements in the correct order. The method works by examining each set of adjacent elements in the string, from left to right, switching their positions if they are out of order. The algorithm then repeats this process until it can run through the entire string and find no two elements that need to be swapped.


Performance

Best Case Time Complexity: O(n)
Average Case Time Complexity: O(n2)
Worst Case Time Complexity: O(n2)

Insertion Sort

Insertion Sort is an in-place comparison-based sorting algorithm. Here, a sub-list is maintained which is always sorted. For example, the lower part of an array is maintained to be sorted. An element which is to be 'insert'ed in this sorted sub-list, has to find its appropriate place and then it has to be inserted there. Hence the name, insertion sort.


Performance

Best Case Time Complexity: O(n)
Average Case Time Complexity: O(n2)
Worst Case Time Complexity: O(n2)

Selection Sort

Selection sort is a simple sorting algorithm. This sorting algorithm is an in-place comparison-based algorithm in which the list is divided into two parts, the sorted part at the left end and the unsorted part at the right end. Initially, the sorted part is empty and the unsorted part is the entire list.

The smallest element is selected from the unsorted array and swapped with the leftmost element, and that element becomes a part of the sorted array. This process continues moving unsorted array boundary by one element to the right.


Performance

Best Case Time Complexity: O(n2)
Average Case Time Complexity: O(n2)
Worst Case Time Complexity: O(n2)

Merge Sort

Merge sort follows divide and conquer approach in which, the list is first divided into the sets of equal elements and then each half of the list is sorted by using merge sort. The sorted list is combined again to form an elementary sorted array.


Performance

Best Case Time Complexity: O(n(logn))
Average Case Time Complexity: O(n(nlogn))
Worst Case Time Complexity: O(n(logn))

Quick Sort

Quick sort is a highly efficient sorting algorithm and is based on partitioning of array of data into smaller arrays. A large array is partitioned into two arrays one of which holds values smaller than the specified value, say pivot, based on which the partition is made and another array holds values greater than the pivot value.

Quicksort partitions an array and then calls itself recursively twice to sort the two resulting subarrays


Performance

Best Case Time Complexity: O(n(logn))
Average Case Time Complexity: O(n(logn))
Worst Case Time Complexity: O(n2)

About Us

Siddhesh Mane

Student at Thakur College of Engineering and Technology.

Hritik Pandey

Student at Thakur College of Engineering and Technology.

Rahul Prajapati

Student at Thakur College of Engineering and Technology.

Contact Us

Have any doubts, feel free to Contact Us

Send Message