Question: 9. (10 points) What is the runtime complexity of Adam's famous string splitter code? Hint: Make sure to look into the source code for string.find()

 9. (10 points) What is the runtime complexity of Adam's famous

9. (10 points) What is the runtime complexity of Adam's famous string splitter code? Hint: Make sure to look into the source code for string.find() in the C++ std library. I've included that code (downloaded from GNU) static vector pieces; int location = text.find(delimiter); int start = 0; //while we find something interesting != while (location string ::npos){ //build substring string piece = text, substr(start, location - start); pieces.push_back(piece); start = location + 1; //find again location-text.find (delimiter, start); string piece = text, substr(start, location - start); pieces.push back(piece); return pieces; GCC/G++ source downloaded from: http://mirrors.concertpass.com/gcc/releases/gcc- 6.3.01 Source file: gcc-6.3.0/1ibstdc++-v3/include/ext/vstring.tcc template typename versastring<_chart traits _alloc base::size type>:: find(const-CharT.-5, size-type-pos, size-type-n) const _alibcxx-requires-string-len(-_c, n); const size_type-size = this-size(); const-CharT*--data = this-> M data(); if (-n == 0) return-pos

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!