- 博客(4)
- 收藏
- 关注
原创 C++ 虚函数及其实现 【包含类的相关基础知识】
/* 一些类的辅助知识【 继承与派生 】B是A: class B: public A {...} * B中函数不可访问A的private成员,可访问protect成员; * 在B中访问A中同名成员时,需使用‘::’, Eg. A::method1 * 创建B对象时会先调用A中构造函数,后调用B的构造函数。对象销毁时顺序相反。 * 定义B的构造函数:...
2020-03-11 17:52:42
257
原创 【Leetcode 经典题目】370. Range Addition [Math][DP]
Assume you have an array of length n initialized with all 0's and are given k update operations.Each operation is represented as a triplet: [startIndex, endIndex, inc] which increments each element ...
2020-03-10 11:06:55
203
原创 【Leetcode经典题目】1257. Smallest Common Region -- [Mid][Tree/DFS][ListNode]
【题目】You are given some lists of regionswhere the first region of each list includes all other regions in that list.Naturally, if a region Xcontains another region Ythen Xis bigger than Y. Also...
2020-03-09 10:42:02
204
原创 【Leetcode 经典题目】5355. Frog Position After T Seconds [Hard][BFS/Queue][Tree]
【题目】Given an undirected treeconsisting of n vertices numbered from 1 to n. A frog starts jumpingfrom the vertex 1. In one second, the frogjumps from itscurrentvertex to another unvisited vertex...
2020-03-08 19:01:01
152
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人