C++ Algorithmic thinking Public



Implement function countNumbers that accepts a sorted vector of integers and counts the number of vector elements that are less than the parameter lessThan.

For example, for vector v containing { 1, 3, 5, 7 }, SortedSearch::CountNumbers(v, 4) should return 2 because there are two vector elements less than 4.


  •   Example case: Exception
  •   Various small vectors: Exception
  •   Performance test when sortedVector contains lessThan: Exception
  •   Performance test when sortedVector doesn't contain lessThan: Exception