Skip to content

Commit c339b9a

Browse files
committed
update
1 parent b5c394e commit c339b9a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

C++/design-log-storage-system.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// Time: O(logn)
1+
// Time: put: O(logn), n is the size of the total logs
2+
// retrieve: O(logn + d), d is the size of the found logs
23
// Space: O(n)
34

45
class LogSystem {
@@ -12,12 +13,10 @@ class LogSystem {
1213
granularity_["Second"] = 19;
1314
}
1415

15-
// Time: O(logn), n is the size of the total logs
1616
void put(int id, string timestamp) {
1717
lookup_.emplace(timestamp, id);
1818
}
1919

20-
// Time: O(logn + d), d is the size of the found logs
2120
vector<int> retrieve(string s, string e, string gra) {
2221
s = s.substr(0, granularity_[gra]) + s_filter_.substr(granularity_[gra]);
2322
e = e.substr(0, granularity_[gra]) + e_filter_.substr(granularity_[gra]);

0 commit comments

Comments
 (0)