forked from pgRouting/GSoC-pgRouting
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get familiar with C++ #2
Comments
Michael VanLoon “STL Algorithms in Action ”STL in C++ is useful. By using STL, we spend less time coding and focus on other important things. For instance, by using accumulate(s.begin(),s.end()), which is used for calc the sum of a container, we can save time in writing sth. like: ll ans=0;
for(auto p:s) ans+=p;
return p; There are various useful algorithms: - sort
- nth_element
- rotate(it_fir, it_mid, it_end)
- slide
- gather //means gather element with same types together
- set_difference(a.begin(),a.end(),b.begin(),b.end().back_inserter(new_items)); // return new_items (set of what is exist in $a$ and not exist in $b$ )
- stable_partition |
T. Winters & H. Wright “All Your Tests are Terrible..."How to make good tests? Correctness
Readability
Completeness
Demonstrability
Resilience |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: