>The linked list version is still a little faster.
What about the dynamic array version? Have you tested this with stdin as the stream or just a file? Do all of the options work with stdin? Which is faster?
>The linked list version is still a little faster.
What about the dynamic array version? Have you tested this with stdin as the stream or just a file? Do all of the options work with stdin? Which is faster?
My best code is written with the delete key.
You could well find that when reading from a file, that the program you run 2nd is always quicker due to file caching.
I haven't checked the dynamic array version, yet.
I ran the two programs multiple times, and it always turned out that the linked list version was a little faster. Within the program itself, I read from the file, which had about 6000 lines, 10 times times. So the time you saw was actually 10 passes through the file.