Giter Club home page Giter Club logo

problem-solving's Introduction

Problem Sovling

  1. Arrays
    1. 2 Sum
      1. Time Complexity - O(n)
      2. Space Complexity - O(n)
    2. Median of 2 sorted arrays
      1. Time Complexity - O(log(min(m,n))
      2. Space Complexity - O(1)
    3. Container With Most Water
      1. Time Complexity - O(n)
      2. Space Complexity - O(1)
    4. 3 Sum
      1. Time Complexity - O(n^2)
      2. Space Complexsity - O(1)
    5. 3 Sum Closest
      1. Time Complexity - O(n^2)
      2. Space Complexity - O(1)
    6. 4 Sum
      1. Time Complexity - O(n^3)
      2. Space Complexity - O(1)
    7. Remove Duplicates Sorted Array
      1. Time Complexity - O(n)
      2. Space Complexity - O(1)
    8. Remove Elements In Place
      1. Time Complexity - O(n)
      2. Space Complexity - O(1)
    9. Next Permutation Lexicographycally
      1. Time Complexity - O(n)
      2. Space Complexity - O(1)
    10. Search In Rotated Sorted Array
      1. Time Complexity - O(logn)
      2. Space Complexity - O(1)
    11. Find First And Last Index In Sorted Array
      1. Time Complexity - O(logn)
      2. Space Complexity - O(1)
    12. Search Insert Position
      1. Time Complexity - O(logn)
      2. Space Complexity - O(1)
    13. Combination Sum With Repetition
      1. Time Complexity - O(n^(n/2))
      2. Space Complexisty -
  2. Sorting
    1. Selection Sort
      1. In place
      2. Not stable
      3. Best case - O(1/2 * n^2)
      4. Average Case - O(1/2 * n^2)
      5. Worst Case - O(1/2 * n^2)
    2. Insertion Sort
      1. In Place
      2. Stable
      3. Best Case - O(n)
      4. Average Case - O(1/4 * n^2)
      5. Worst Case - O(1/2 * n^2)
      6. Use for small or partially sorted arrays
    3. Bubble Sort
      1. In Place
      2. Stable
      3. Best Case - O(n)
      4. Average Case - O(1/2 * n^2)
      5. Worst Case - O(1/2 * n^2)
      6. Rarely used, insertion sort can be preferred
    4. Shell Sort
      1. In Place
      2. Stable
      3. Best Case - O(nlogn)
      4. Average - O(nlogn)
      5. Worst - O(n^2)
    5. Merge Sort
      1. Not In Place
      2. Stable
      3. Best Case - O((1/2)(nlogn))
      4. Average Case - O(nlogn)
      5. Worst Case - O(nlogn)
      6. Space complexity - O(n)
    6. Quick Sort
      1. In place
      2. Not Stable
      3. Best Case - O(nlogn)
      4. Average Case - O(nlogn)
      5. Worst Case - O(n^2)
      6. Space Complexity - O(1)
    7. Heap Sort
      1. In place
      2. Not Stable
      3. Best Case - O(n)
      4. Average Case - O(nlogn)
      5. Worst Case - O(nlogn)
  3. Searching
    1. Sequential Search
      1. Worst Case
        1. Search - O(n)
        2. Insert - O(n)
        3. Delete - O(n)
      2. Average Case
        1. Search - O(n)
        2. Insert - O(n)
        3. Delete - O(n)
    2. Binary Search
      1. Worst Case
        1. Search - O(log(n))
        2. Insert - O(n)
        3. Delete - O(n)
      2. Average Case
        1. Search - O(log(n))
        2. Insert - O(n)
        3. Delete - O(n)
    3. Hash Table
      1. Worst Case
        1. Search - O(n)
        2. Insert - O(n)
        3. Delete - O(n)
      2. Average Case (Provided the hash function is uniform)
        1. Search - O(1)
        2. Insert - O(1)
        3. Delete - O(1)
    4. Binary Search Tree
      1. Worst Case
        1. Search - O(n)
        2. Insert - O(n)
        3. Delete - O(n)
      2. Average Case
        1. Search - O(logn)
        2. Insert - O(logn)
        3. Delete - sqrt(n)
  4. Graph Processing 1.

problem-solving's People

Contributors

pushparajkvp avatar

Stargazers

 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.