Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

deathook007/Data-Structures-and-Algorithms

Repository files navigation

Screenshot-1

Complexity Analysis πŸ“ˆ

Screenshot-1

Linear Search

  • Time complexity : O(n)
  • Space complexity : O(1)

Binary Search

  • Time complexity : O(log(n))
  • Space complexity :
  • Itterative version - O(1)
    
  • Recursive version - O(n) 
    
Binary search works on monotonic functions (non-increasing or non-decreasing)

Jump Search

  • Time complexity : O(√n)
  • Space complexity : O(1)

Interpolation Search

  • Time complexity : O(log(log(n)))
  • Space complexity : O(1)
Time Complexity increases with the increase in non uniformity of data. For uniformily distributed data Interpolation Search is better than Binary Search while it keeps on changing as uniformity of data changes and go upto O(n), while in case of Binary search its O(log(n)) dispite of how data is distributed in shorted array. Here is the average complexity considering most data to be uniform.

Exponential Search

  • Time complexity : O(log(n))
  • Space complexity :
  • Itterative version - O(1)
    
  • Recursive version - O(n) 
    
Time Complexity depends on binary search only not exponential searcch(O(1)). The Exponential Search is better than Binary Search in every case specially for UNBOUNDED ARRAYS

Fibonacci Search

  • Time complexity : O(log(n))
  • Space complexity : O(1)

Bubble Sort

  • Time complexity : O(n2)
  • Space complexity : O(1)

Insertion Sort

  • Time complexity : O(n2)
  • Space complexity : O(1)

Selection Sort

  • Time complexity : O(n2)
  • Space complexity : O(1)

Inbuilt Sort

  • Time complexity : O(n)
  • Space complexity : O(1)

Counting Sort

  • Time complexity : O(n + Range) ~ O(n)
  • Space complexity : O(Range)

About

Best DSA Questions Repository for Begineers to Intermidiate in C++

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /