Skip to content

Important Searching and Sorting techniques are available here.

Notifications You must be signed in to change notification settings

surazkarn/Searching-and-Sorting-Techniques

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

Searching-and-Sorting-Techniques

=> Selection Sort :

select the first element as the minimumNumber in the unsorted array , compare it with second element, if it smaller then the minimumNumber then swap with it, if not move to another element and check same for it, repeat it till n-1 elements of the array.

  • Time Complexity : O(n^2)
  • Space Complexity : O(1)

=> Bubble Sort :

Repeatedly compare the adjacent elements ,if arr[j]>arr[j+1] swap them. The maximum element bubbles up to the end of the unsorted array after each iteration. After n-1 iterations, we get sorted array.

  • Time Complexity : O(n^2)
  • Space Complexity : O(1)

=> Insertion Sort :

Inplace logic of shifting and inserting elements.

Releases

No releases published

Packages

No packages published

Languages