1

I want to append a list of strings to another string one by one (not all at once). Based on the description of paste(), its complexity should be more similar to c() below.

what is time complexity of append (vector / list)?

Is there a way to make repetitive appending strings to another string run in time linear to the total length of the strings appended?

user1424739
  • 11,937
  • 17
  • 63
  • 152
  • When you say 'not all at once', when are they arriving that isn't satisfied by [didn't this answer](https://stackoverflow.com/questions/68668604/what-is-time-complexity-of-append-vector-list/68669901), which is to say, why would `n` be important if the strings aren't at hand? – Chris Aug 05 '21 at 17:35
  • See context here. https://stackoverflow.com/questions/68669493/read-a-tsv-file-group-by-group-efficiently – user1424739 Aug 05 '21 at 17:37
  • 1
    Would that be similar to [r and awk](https://livefreeordichotomize.com/2019/06/04/using_awk_and_r_to_parse_25tb/), which falls into the 'If you have to ask the price, you can't afford it' category $12 of the TSV? And is this streaming... – Chris Aug 05 '21 at 17:55
  • That solution is too complicated. But the idea should be similar. The devil is in the details. It split into files. For my question, I don't want to use files. – user1424739 Aug 05 '21 at 18:27
  • Well, I guess I'd ask, as a client might, how you'd audit your process if these 'items' exist only as (temp) objects without reference to disk? – Chris Aug 05 '21 at 18:39

0 Answers0