1. Engineering
  2. Computer Science
  3. 7 what is the bigoh runtime for a function that...

Question: 7 what is the bigoh runtime for a function that...

Question details

7. What is the Big-Oh runtime for a function that passes in an STL list of strings and then removes all strings in this list that have a size of 10 or larger. The function uses an iterator that steps through the list one item (string) at a time, calling erase on each string that it finds that has a size of 10 or larger. The string’s size function has a runtime of O(1).

8. If instead of the erase function, the programmer uses the STL list’s remove function in the previous question, what is the function's Big-Oh runtime now?

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution