Coder Social home page Coder Social logo

dsa-90-days's Introduction

DSA-90-days

A repository to track my DSA progress

https://whimsical.com/dsa-in-90-days-EmPkf5utoFGRMnRqJjM6YV

Space and Time Complexity ( Day 1-2 )

1.Analysis of  Algorithms


2.Asymptotic Analysis

  - Measures the order of growth.   
  
  - Consider only those terms that have highest order growth and ignore the remaining terms. 
  
  
3.Order of Growth

  - How fast the program execution time f(n) increases wrt to the input size 'n' , where f(n) is program execution time.   
  
  - c < log log(n) < log(n) < n^(1/3) < n^(1/2) < n < n log(n) < n^2 < n^3 < 2^n < e^n < n^n
  
  
 4.Best, Average, Worst Case
  
  - We always consider the worst case scenario.
  
  
 5.Asymptotic Notations
 
  - Represents the order of growth in mathematical form.
  
  - Big O => Exact or upper bound      
  
  - Theta => Exact bound
  
  - Omega => Exact or lower bound
  
  - We are interested in exact or upper bound notation.
  
  
 6.Analysis of Recursion
 
  - Recurrence Relations
  
 7.Space Complexity
  
  - Space Complexity -> Order of growth of space or memory (RAM size) with respect to the input size 'n'.
  
  - Auxiliary Space Complexity -> Order of growth of  EXTRA memory space or (RAM memory) with respect to the input size 'n'.

Recursion and Backtracking ( Day 3-10 )

1.Recursion 

- A function calling itself directly or indirectly is called as Recursion.

- Direct recursion -> A function calls itself directly inside the same function. 

 int fun(int n){
  ----
  ----
  return fun(n-1);
 }

- Indirect recursion -> A function indirectly calls itself through another function.

 int fun1(){
  ---
  ---
  fun2()
  ---
  }

 int fun2(){
  ---
  ---
  fun1()
  ---
  }
 
2.Applications of Recursion 

 - Dynamic Programming, Backtracking, Divide and Conquer( MergeSort, BinarySearch, QuickSort ),  DFS, Searching a file in a file system etc.....
 
 - Pros -> Easy to implement a recursive solution than an iterative solution.
 
 - Cons -> Lot of function overheads , space complexity increases when recursion is used.
 
3.Tail Recursion

dsa-90-days's People

Contributors

koolgokul22 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.