stack

2021-06-19

Stack栈,是一种后进先出的数据结构,在进行递归的时候,很适合使用。这里总结了两篇Stack 1, Stack 2

stack,queue属于STL,但不是container,是属于co...

Read More

hash rolling hash

2021-06-17

Rolling Hash

See book Introduction to Algorithm in P582 with presudo code.

Read More
    

tree map set

2021-06-14

Ordered Map(ordered set)

  • Ordered Map: at(can be used in const map; and throw exception),比[]好在如果不存在就会抛出异常,但是[]不会抛出,不存在就插入; begin, cb...
Read More

tree segment tree

2021-06-13

线段树是进行区间信息查询维护和修改的数据结构。

// 1353. Maximum Number of Events That Can Be Attend...
      
Read More

tree binary indexed tree

2021-06-12
  • 使用情况

对于值变化的固定大小的数组进行求解前缀和以及区间和,以及在构造完整的树状数组过程中,保留某些值用于最后求解。

更新的时间复杂度为:O(log(n))

询问的时间复杂度为:O(log(n))

  • 原理

即我们希望构造出一个树,树的每个节点代表了...

Read More