Skip to content

frits-scholer/oef-stl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oef-stl exercises in stl

ex01.cpp

ex. 6 from ch 7 of CS106L course reader. Read contents of a file in a multiset. Use distance and accumulate to calculate the average of the values between 25 and 75.

ex02.cpp

ex. 7. Using remove_if and a custom callback function, write a function RemoveShortWords that accepts a vector and removes all strings of length 3 or less from it.

ex03.cpp

ex. 8. Calculate distance of a point in space to origin. Write a function DistanceToOrigin that accepts a vector and returns the distance to the origin. Use inner_product.

ex04.cpp

ex. 9. Function BiasedSort takes reference to vector and sorts it putting strings "Me First" first.

ex05.cpp

ex 10. Function CriticsPick accepts a map<string, double> of movies and their ratings and returns a set of the names of the top 10 movies in the map.

ex06.cpp

ex. 12. Use generate_n, rand and back_inserter to populate a vector with a specified number of random values. Then use accumulate to compute the average of the range.

ex07.cpp

ex. 13. Write a function to calculate median using nth_element algorithm.

ex08.cpp

ex. 14. Use copy, istreambuf_iterator, ostreambuf_iterator to open a file and print its content to cout.

About

exercises in stl

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published