Press "Enter" to skip to content

Posts tagged as “sp”

KMP Algorithm SP19

KMP Algorithm, KMP 字符串搜索算法

Time complexity: O(m+n)
Space complexity: O(m)

Implementation

C++

Python3

Applications

LeetCode 28. strStr()

C++

LeetCode 459. Repeated Substring Pattern

C++

1392. Longest Happy Prefix

C++

花花酱 LeetCode Binary Trees 二叉树 SP12

Binary tree is one of the most frequently asked question type during interview.

二叉树是面试中经常会问到的问题。

The candidate needs to understand the recursively defined TreeNode and solve the problem through recursion.

面试者需要理解递归定义的TreeNode数据类型,并且通过使用递归的方式来解决问题。

 










花花酱 SP5 Binary Search

Template:

Time complexity: O(log(r-l)) * O(f(m) + g(m))

Space complexity: O(1)

 

Slides:

Lower Bound / Upper Bound

Mentioned Problems