problemscpp
A collection of my answers to algorithm problems in c++.
| 函数
leetcode::all_oone_data_structure 命名空间参考

LeetCode 432. All O`one Data Structure 更多...

class  AllOne
 

函数

 TEST (all_oone_data_structure, case1)
 

详细描述

LeetCode 432. All O`one Data Structure

函数说明

◆ TEST()

leetcode::all_oone_data_structure::TEST ( all_oone_data_structure  ,
case1   
)

在文件 leetcode_test.cpp2290 行定义.

2290 {
2291 AllOne ao;
2292 ao.inc("a");
2293 ao.inc("b");
2294 ao.inc("b");
2295 ao.inc("c");
2296 ao.inc("c");
2297 ao.inc("c");
2298 ao.dec("b");
2299 ao.dec("b");
2300 ao.getMinKey();
2301 ao.dec("a");
2302 ao.getMaxKey();
2303 ao.getMinKey();
2304 }
string getMaxKey()
Returns one of the keys with the maximal count.
Definition: leetcode.cpp:4606
string getMinKey()
Returns one of the keys with the minimum count.
Definition: leetcode.cpp:4613
void dec(const string &key)
Decrements the count of the string key by 1. If the count of key is 0 after the decrement,...
Definition: leetcode.cpp:4585
void inc(const string &key)
Increments the count of the string key by 1. If key does not exist in the data structure,...
Definition: leetcode.cpp:4569

引用了 leetcode::all_oone_data_structure::AllOne::dec(), leetcode::all_oone_data_structure::AllOne::getMaxKey(), leetcode::all_oone_data_structure::AllOne::getMinKey() , 以及 leetcode::all_oone_data_structure::AllOne::inc().