problemscpp
A collection of my answers to algorithm problems in c++.
| Public 成员函数 | Public 属性 | Private 类型 | 所有成员列表
leetcode::range_module::Chtholly类 参考

#include <leetcode.h>

struct  Node
 

Public 成员函数

void assign (unsigned l, unsigned r, type val=false)
 
bool check (unsigned l, unsigned r)
 
auto split (unsigned pos)
 

Public 属性

set< Nodes
 

Private 类型

using type = bool
 

详细描述

在文件 leetcode.h3318 行定义.

成员类型定义说明

◆ type

在文件 leetcode.h3319 行定义.

成员函数说明

◆ assign()

void leetcode::range_module::Chtholly::assign ( unsigned  l,
unsigned  r,
type  val = false 
)
inline

在文件 leetcode.h3344 行定义.

3344 {
3345 const auto it = split(r + 1);
3346 s.erase(split(l), it);
3347 s.emplace(l, r, val);
3348 }
auto split(unsigned pos)
Definition: leetcode.h:3334

引用了 s , 以及 split().

被这些函数引用 leetcode::range_module::RangeModule::addRange() , 以及 leetcode::range_module::RangeModule::removeRange().

◆ check()

bool leetcode::range_module::Chtholly::check ( unsigned  l,
unsigned  r 
)
inline

在文件 leetcode.h3350 行定义.

3350 {
3351 const auto it = split(r + 1);
3352 return std::all_of(split(l), it, [](auto &&n) { return n.data; });
3353 }

引用了 split().

被这些函数引用 leetcode::range_module::RangeModule::queryRange().

◆ split()

auto leetcode::range_module::Chtholly::split ( unsigned  pos)
inline

在文件 leetcode.h3334 行定义.

3334 {
3335 auto it = s.lower_bound({pos});
3336 if(it != s.end() && it->l == pos)
3337 return it;
3338 auto [l, r, d]{*--it};
3339 s.erase(it);
3340 s.emplace(l, pos - 1, d);
3341 return s.emplace(pos, r, d).first;
3342 }

引用了 s.

被这些函数引用 assign() , 以及 check().

类成员变量说明

◆ s

set<Node> leetcode::range_module::Chtholly::s

在文件 leetcode.h3332 行定义.

被这些函数引用 assign() , 以及 split().


该类的文档由以下文件生成: