/Leetemplate

This project aims to offer a set of commonly-used data structures/algorithm templates. Those data structures is not covered by Java Standard Library yet.

Primary LanguageJava

Leetemplate

This project comes from my daily hobby of practising Leetcode. After finished solving around 200 problems, I somehow realized those problems follow a set of patterns. In order to better organise my knowledge and make those 'patterns' tangible, I started writing them down.

This project does not contain any solutions of Leetcode or solve any Leetcode problems directly, it is a set of highly conclusive templates for common algorithms and data-structures. As long as you understand those core patterns, you can apply those core ideas to efficiently solve problems.

Another goal of this project is to offer a set of algorithms/data-structures templates with a decent code quality, so they can be used in production services, helping developers to solve some real problems in their daily work. That is also why the focus of this project is not purely showing the theory of algorithms, but also emphasize the code usability.

Featured by:

  • zero dependency
  • detailed explanation
  • generic parameterized templates for easy usage
  • all are examined by Leetcode problems, which gives more confidence

What are done

  • Graph
    • Topology Sort
    • Cutting Edge
  • Array
    • Binary Search Array
    • Prefix Sum Array
  • Min/Max Heap
    • Top K Frequency List
  • Queue
    • Monotonic Queue
  • Tree
    • Binary Tree
      • deserialize/serialize
  • Union Find
    • Generic Union Find Set
    • Integer Union Find Set
  • String
    • Trie