reset password
Author Message
duck10438
Posts: 36
Posted 17:30 Jul 15, 2020 |

I know that we are allowed to talk about code as long we don't actually tell each other exactly what it is supposed to be.

For my importCSV method, uploading data takes me nearly a minute probably due to me programming O(n^2)

What algorithm can I implement to have a better worse case time complexity or have you used a feature given by the dotnet documentation?

Amirebm
Posts: 8
Posted 17:39 Jul 15, 2020 |

The best way is to go through your CSV file line by line using one loop. I did the same thing and it takes about 30-40 seconds to import all the data to the database. If you only use one loop to go through each row, you're doing the right thing. Note that, a single loop isn't O(N^2)

cysun
Posts: 2935
Posted 22:50 Jul 15, 2020 |

See my post on performance here.