Skip to content

AHGGG/divide-and-conquer-leetcode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

Divide and conquer all leetcode problems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%