Giter Site home page Giter Site logo

divide-and-conquer-leetcode's Introduction

divide-and-conquer-leetcode

Divide and conquer all leetcode problems.

Introduction

Every one trys to learn various methods to solve leetcode problems. However, few people grasp the core of all algorithms and therefore most of us cannot solve novel problems we didn't seen before.

To overcome all these problems, I want to have a experiment on solving every leetcode problem with divide and conquer. If I can prove this, give me your star; If I fail, no regret.

Spirit

  • Use divide-and conquer purely.
  • Ok if pass all leetcode tests.
  • Solutions should obey complexity (time and space) constraints of the problem.

Setting

To be practical, I only use Java and C++ for all experiments (although Scala and Rust are better). The world has not been prepared for everything.

  • Java is terrible in the field of abstraction and expression.
  • C++ is terrible at clean abstraction and full of traps.

Strategies

We can classify divide-and-conquer algorithms based on how they divide problems.

  • Type 0: init part :+ the last element
  • Type 1: Equally divide into two parts

For more details, please refer to the Strategy doc.

Epilogue

Fuck leetcode, long live divide-and-conquer!

divide-and-conquer-leetcode's People

Contributors

ahggg avatar ireina7 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.