-
Notifications
You must be signed in to change notification settings - Fork 34
/
Built-in functions 01.cpp
22 lines (20 loc) · 1.6 KB
/
Built-in functions 01.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
pointers & iterators , begin, end, Lexicographical
count(begin, end, val) //returns number of occurences of val //O(N)
count_if(begin, end, f) //returns number of occurences that satisfy f //O(N)
min_element(begin, end) //returns an iterator //O(N)
max_element(begin, end) //returns an iterator //O(N)
max(val, val) //returns the maximum value
min(val, val) //returns the minimum value
copy(begin1, end1, begin2) //iterator //O(N)
fill(begin, end, val) //O(N)
reverse(begin, end) //~O(N)
sort(begin, end, f) //Ascendignly //O(NLog(N))
nth_element(begin, nth_element_itr, end) //O(N)
unique(begin, end) //iterator //O(N)
find(begin, end, val) //iterator //O(N)
binary_search(begin, end, val) //bool //O(Log(N))
lower_bound(begin, end, val) //iterator >= //O(Log(N))
upper_bound(begin, end, val) //iterator > //O(Log(N))
equal_range(begin, end, val) //pair<iterator, iterator> //O(Log(N))
next_permutation(begin, end) //bool //O(N)
prev_permutation(begin, end) //bool //O(N)