Skip to content

shovo896/searching-and-sorting-Algorithm

Repository files navigation

Here are descriptions of the sorting and searching algorithms mentioned on the files :

  • Quicksort : A divide-and-conquer sorting algorithm that selects a pivot, partitions the array around it, and recursively sorts the partitions. It has an average-case time complexity of O(n log n).

  • Binary Search: An efficient searching algorithm that works on sorted arrays. It repeatedly divides the search space in half until the target value is found, giving it a time complexity of O(log n).

    Bubble Sort: A simple sorting algorithm that repeatedly swaps adjacent elements if they are in the wrong order. It has a worst-case time complexity of O(n²).

  • Heap Sort: Uses a heap data structure to sort elements by repeatedly extracting the maximum or minimum element. It has a worst-case time complexity of O(n log n).

  • Insertion Sort: Works by picking elements one by one and inserting them into their correct position within a growing sorted section. It has a worst-case time complexity of O(n²).

  • Linear Search: A basic searching algorithm that scans each element in the array sequentially until the target is found. Its time complexity is O(n).

  • Optimized Bubble Sort: A variation of Bubble Sort that tracks whether swaps occur, allowing it to terminate early if the array is already sorted. The time complexity remains O(n²) but improves in best-case scenarios.

  • Selection Sort: Sorts by repeatedly finding the smallest element and moving it to its correct position. It has a worst-case time complexity of O(n²).

About

Normal searching and sorting Algorithm in data structures

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published