0% found this document useful (0 votes)
10 views

Algorithms Searching Sorting

Basic Information of all sorting and searching algorithm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Algorithms Searching Sorting

Basic Information of all sorting and searching algorithm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Algorithm Type

Best TimeWorst
Complexity
Time
Average
Complexity
Time Complexity
Space Complexity
Stable In-Place Recursive
Comparison-Based
Linear Sea Search O(1) O(n) O(n) O(1) N/A Yes No N/A
Binary Sea Search O(1) O(log n) O(log n) O(1) N/A Yes No N/A
Bubble SorSort O(n) O(n^2) O(n^2) O(1) Yes Yes No Yes
Selection SSort O(n^2) O(n^2) O(n^2) O(1) No Yes No Yes
Insertion SSort O(n) O(n^2) O(n^2) O(1) Yes Yes No Yes
Merge SortSort O(n log n) O(n log n) O(n log n) O(n) Yes No Yes Yes
Quick Sort Sort O(n log n) O(n^2) O(n log n) O(log n) No Yes Yes Yes
Heap Sort Sort O(n log n) O(n log n) O(n log n) O(1) No Yes Yes Yes
Radix Sort Sort O(nk) O(nk) O(nk) O(n+k) Yes No No No
Bucket SorSort O(n+k) O(n^2) O(n+k) O(n) Yes No No No
Counting SSort O(n+k) O(n+k) O(n+k) O(k) Yes No No No
Shell Sort Sort O(n log n) O(n^2) O(n log n) O(1) No Yes No Yes
Online/Offline
Best UseMaster
Case Complexity
Divide-and-Conquer
Adaptiveness
Parallelizable
Cache-Friendly
Stability Issues
Additional Notes
Online Small unsoO(n) No No No Yes N/A Simple but inefficient for large data
Online Sorted/partO(log n) No No No Yes N/A Requires sorted data for optimal perfor
Offline Learning p N/A No No No No No Slow but easy to implement
Offline Small data N/A No No No No Yes Selects the smallest/largest element eac
Online Almost sorN/A No Yes No Yes No Good for real-time systems
Offline Merging soT(n) = 2T(nYes No Yes Yes No Efficient for large datasets
Offline Divide-andT(n) = T(n/ Yes No Yes Yes Yes Performance varies based on pivot choi
Offline Priority Q T(n) = T(n/ No No Yes Yes Yes Useful in implementing heaps
Offline Fixed digit N/A No No No No No Best for integer sorting with limited ran
Offline Uniform disN/A No No No No No Works best with uniformly distributed d
Offline Integer sorN/A No No No No No Efficient for small integer ranges
Offline PerformancN/A No Yes Yes Yes Yes Tuning-based optimization
t inefficient for large data
sorted data for optimal performance
easy to implement
e smallest/largest element each time
real-time systems
or large datasets
nce varies based on pivot choice
mplementing heaps
nteger sorting with limited range
st with uniformly distributed data
or small integer ranges
sed optimization

You might also like