by meric · 10y ago · 0 comments
In the end I put my Big O knowledge in the drawer and stripped linked lists from the program I was working on, and got the 100x improvement in overall performance I was looking for.
I had also used a linked list of characters to represent strings to iterate through them one by one. This was very slow compared to iterating through an array.
Linked-lists were supposed to be O(1) inserting at the head, and O(n) iterating through it. However, it's no match against array O(1) assignment and O(n) array iteration.