I Will Get That Job At Google. | Effective string inversion. Naive approach vs...
Let's try to invert string using a char array and a StringBuilder. This will need O(N) memory, where N is the length of a given string. It's fact that O(N) is the minimal amount of memory which we need for this task because initial char array is being stored in memory during the whole process flow. It will also need O(N) time, so it's also minimal amount of time needed for the algorithm.
Read full article from I Will Get That Job At Google. | Effective string inversion. Naive approach vs...
No comments:
Post a Comment